Unlikely Teacher

1. Share Everything* [Programming Gotchas, Technology News, Insights on Living and Everything in Between]

Zend Framework Large File Upload Issues

February 3rd, 2009 · 3 Comments · PHP

I tried modifying this Zend_Form_Element_File example to support larger file uploads but noticed that I’ve been getting “Undefined index” errors when my uploads are bigger than 8MB.

Notice: Undefined index: tmp_name in C:\quickstart\library\Zend\File\Transfer\Adapter\Abstract.php on line 589

Notice: Undefined index: name in C:\quickstart\library\Zend\Validate\File\Size.php on line 398

Notice: Undefined index: tmp_name in C:\quickstart\library\Zend\File\Transfer\Adapter\Abstract.php on line 589

Notice: Undefined index: name in C:\quickstart\library\Zend\Validate\File\Extension.php on line 228

Being a PHP and Zend Framework newbie, I wanted to put the blame on Zend but in the end I found the reason for the upload and validation errors after much googling.

The solution requires updating two properties in php.ini:

upload_max_filesize = 32M
post_max_size = 32M

With these changes you can now upload relatively bigger files!

Just make sure that your hosting provider supports your file upload size settings.

Share and Enjoy:
  • Digg
  • del.icio.us
  • Facebook
  • Google Bookmarks
  • DZone
  • Reddit
  • StumbleUpon
  • Tumblr
  • Twitter

Tags: ··

3 Comments so far ↓

  • JIRA: Zend Framework

    [ZF-5357] Error by Upload…

    I got the same Zend File Upload errors.

    Apparently, I was uploading a file bigger than the allowable limit set in php.ini. This was fixed by updating……

  • Thomas

    Use setMaxFileSize to limit the accepted size at the file element. Your browser will then automatically throw an error/not accept this file.

  • dayg

    Ah yes, that would help if I wanted to limit the maximum file size.

    But my original problem was I wanted to increase the allowed file size for file uploads.

    I initially thought it was something I could set from within Zend without knowing about the defaults set in php.ini.

Leave a Comment