Images too big...

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
Zoram
Forum Contributor
Posts: 166
Joined: Sun Aug 18, 2002 3:28 pm
Location: Utah
Contact:

Images too big...

Post by Zoram »

I am working on an image upload script that is working just fine. The problem that I'm having is that any images that are over 2 MB trigger an error in the $_FILE array and doesn't give it a temp name so the is_uploaded_file($_FILES['file']['tmp_name']) doesn't register.

Any Suggestions?
User avatar
dbevfat
Forum Contributor
Posts: 126
Joined: Tue Jun 28, 2005 2:47 pm
Location: Ljubljana, Slovenia

Post by dbevfat »

this is max_upload_size and max_post_size limits problem, see
http://www.php.net/manual/en/features.file-upload.php at Related Configurations Note:
User avatar
raghavan20
DevNet Resident
Posts: 1451
Joined: Sat Jun 11, 2005 6:57 am
Location: London, UK
Contact:

Post by raghavan20 »

max_upload_size looks like a constant defined in php.ini file.
can anyone tell the default size for that???
it appears max size of the file that could be uploaded could be controlled by the form as the documentation says but also says there are ways to get around them...what r those???jus curious :roll:
User avatar
Zoram
Forum Contributor
Posts: 166
Joined: Sun Aug 18, 2002 3:28 pm
Location: Utah
Contact:

Post by Zoram »

Many settings, although they do get set, have no influence in your script.... like upload_max_filesize will get set but uploaded files are already passed to your PHP script before the settings are changed.

Also other settings, set by ini_set(), may be to late because of this (post_max_size etc.).
beware, try settings thru php.ini or .htaccess.
This was in the ini_set function manual comments. Does that mean there is really no way to use ini_set to change it. I'm not sure if the host will allow me access to the ini file.
Post Reply