Capturing errors when a large file is uploading

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
eruna
Forum Newbie
Posts: 17
Joined: Mon Jun 28, 2010 2:02 pm

Capturing errors when a large file is uploading

Post by eruna »

When a file is uploaded larger than the max_upload the script is killed and it shows a white screen.
How can I get it to return an error rather than end the script?
I tried using the MAX_FILE_SIZE field in the form, but that only returned an error when the file was below the php max.
Otherwise it also produced a white screen.

Any ideas?

E
User avatar
Crys
Forum Newbie
Posts: 4
Joined: Mon Jun 28, 2010 2:23 pm
Location: Belarus, Minsk

Re: Capturing errors when a large file is uploading

Post by Crys »

post_max_size ?
User avatar
Crys
Forum Newbie
Posts: 4
Joined: Mon Jun 28, 2010 2:23 pm
Location: Belarus, Minsk

Re: Capturing errors when a large file is uploading

Post by Crys »

And much depends on the configuration server. In normal operation, $ _FILES and $ _POST should be empty. Not page :)
eruna
Forum Newbie
Posts: 17
Joined: Mon Jun 28, 2010 2:02 pm

Re: Capturing errors when a large file is uploading

Post by eruna »

Right that's what I meant. It shuts down the script when the file is above the maximum allowed in the PHP ini.
Post Reply