View Full Version : Image upload error if file too large
April 8th, 2005, 01:20 PM
I am getting this error when a large image is uploaded:
Fatal error: Allowed memory size of 20971520 bytes exhausted (tried to allocate 2304 bytes) in /xxxxx/xxxx/xxxxxx/xxxxxxx/classifieds/image-inc.php on line 104
I would of expected a message saying that the file was too large to upload and make it smaller and try again?
April 8th, 2005, 01:23 PM
Unfortunately, PHP doesn't work that way. You need to allocate enough memory to your scripts in the PHP.INI script so that these kinds of things don't happen. There isn't a way to "prequalify" a file before it is sent to the server for processing to catch something like this before it happens.
April 8th, 2005, 01:34 PM
Thanks for the lightening quick reply!
I am on a shared server so I do not have access to the php.ini script, and I have already had server admin increase allocated memory to 20mb to php.
Seems I will have to block picture uploads in case people upload a picture straight from their digital camera without loosing file size. Can I block picture uploads in classifieds?
April 8th, 2005, 04:16 PM
I have asked my server admin about this problem and they pointed me here:
The maximum size of an uploaded file.
they suggest "If you are using PHP you can limit the file upload"
could this help?
vBulletin® v3.8.1, Copyright ©2000-2014, Jelsoft Enterprises Ltd.