Bug #62536 [Com]: file uploads MAX_FILE_SIZE doesn't work as described
Edit report at https://bugs.php.net/bug.php?id=62536&edit=1
ID: 62536
Comment by: Sjon at hortensius dot net
Reported by: danny at tibibi dot com
Summary: file uploads MAX_FILE_SIZE doesn't work as described
Status: Open
Type: Bug
Package: Unknown/Other Function
Operating System: Windows Server 2008
PHP Version: 5.4.4
Block user comment: N
Private report: N
New Comment:
This feature is meant for clients (eg. browsers), but it seems your browser
doesn't implement this feature. PHP doesn't do anything with this variable
More info @
http://stackoverflow.com/questions/1381364/max-file-size-in-php-whats-the-point
Previous Comments:
------------------------------------------------------------------------
[2012-07-11 17:10:07] danny at tibibi dot com
Description:
------------
The documentation for handling file uploads, http://us3.php.net/manual/en/features.file-upload.post-method.php
states that when declaring a hidden field named MAX_FILE_SIZE, if the file submitted is larger, then
the user will not have to wait longer to be told that the file was too large.
<?php
if (isset($_POST['MAX_FILE_SIZE']))
{
echo $_FILES['file1']['error'];
}
?>
<html>
<body>
<form action="/test.php" method="post"
enctype="multipart/form-data">
<input type="hidden" name="MAX_FILE_SIZE" value="100" />
<input type="file" name="file1">
<input type="submit" value="submit">
</form>
</body>
</html>
Actual result:
--------------
The complete file gets uploaded however big it is, and the result shows: 2
This confirms that MAX_FILE_SIZE worked, and the file was too large, but it did not stop processing
the request after 100 bytes were processed.
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=62536&edit=1
Thread (5 messages)