note 17332 deleted from features.file-upload by irc-html
| From: | irc-html@php.net | Date: | Sat, 19 Jan 2002 20:36:36 +0000 |
| Subject: | note 17332 deleted from features.file-upload by irc-html | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-25382@lists.php.net to get a copy of this message | ||
How PHP deal with max file size overflows...
To understand this note have in mind the configuration below:
php.ini Settings
upload_max_filesize = 1M
My Script Settings
<input type=HIDDEN name=MAX_FILE_SIZE value=2097152>
<input type=FILE name=myfile>
In my php.ini settings i had defined that 'upload_max_filesize' is equal to 1 MB, this
means
users cannot upload files greater then 1MB. In another hand, I had defined that
'MAX_FILE_SIZE' is equal to 2MB (2097152 Bytes). This means I can't send files
greater than 2MB.
And then ?
Well, PHP handles max file size overflows in two differents ways...
If the overflow applies to php.ini settings, myfile, myfile_name, myfile_size and myfile_type
will receive null values.
If the overflow applies to MAX_FILE_SIZE, myfile = none, myfile_name=name_of_file, myfile_size =
0 and myfile_type=file_type.
This differences in how to handle max file size overflow it's important when we ought to write
a
file size control function.
So
Well, sorry about my poor english (I'm brazillian) and I hope this is useful for you...