note 17332 added to features.file-upload
| From: | garcia at interage dot com dot br | Date: | Wed, 05 Dec 2001 00:01:50 +0000 |
| Subject: | note 17332 added to features.file-upload | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-21617@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...
--
http://www.php.net/manual/en/features.file-upload.php
http://master.php.net/manage/user-notes.php?action=edit+17332
http://master.php.net/manage/user-notes.php?action=delete+17332
http://master.php.net/manage/user-notes.php?action=reject+17332