I'm working on a PHP form that attaches a file to an email, and trying to gracefully handle cases where the uploaded file is too large.
I've learned that there are two settings in php.ini
that affect the maxiumum size of a file upload: upload_max_filesize
and post_max_size
.
If a file's size exceeds upload_max_filesize
, PHP returns the file's size as 0. That's fine; I can check for that.
But if it exceeds post_max_size
, my script fails silently and goes back to the blank form.
Is there any way to catch this error?
Question&Answers:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…