Zend Framework Large File Upload Issues

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.

Advertisements

4 Comments »

  1. [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……

  2. Thomas said

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

  3. dayg said

    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.

  4. Same problem with me. Any solution

RSS feed for comments on this post · TrackBack URI

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: