|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2007-12-06 13:51 UTC] info at inprosof dot de
Description: ------------ -upload_max_filesize and post_max_size in php.ini set to 100M -file to upload is 140M - All Array ($_POST, $_GET, $_FILES) are empty after uploading file. - File does not exist on server. - No PHP-error or message or notice is requested Problem: without any file size analysing the script can not generate an error for the user. Tested on - windows OS 32bit, PHP 5.1.6 and Apache 2.0 - linux OS, PHP 5.2.5, Apache 2.0 Reproduce code: --------------- please contact me, to send to talk about code. Expected result: ---------------- We except the file size of the file. Actual result: -------------- nothing PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Tue Oct 28 20:00:01 2025 UTC |
The following code (consisting mostly of the example from the php docs) should only allow 300kB files to be uploaded resulting in an UPLOAD_ERR_FORM_SIZE. If you dismiss the hidden field, it should produce an UPLOAD_ERR_INI_SIZE. Emergency stop should be after max_input_time. My Values are: upload_max_size: 8M post_max_size: 8M max_input_time: 60 Reality shows, that a possibly created tmp File stops growing after reaching upload_max_size and is deleted, but upload continues even after 60s (watch with iptraf or something like this). <? print "upload_max_size: ".ini_get("upload_max_filesize")."<br>\n"; print "post_max_size: ".ini_get("post_max_size")."<br>\n"; print "max_input_time: ".ini_get("max_input_time")."<br><br>\n"; print '<form enctype="multipart/form-data" action="'.$_SERVER['PHP_SELF'].'" method="POST"> <input type="hidden" name="MAX_FILE_SIZE" value="300000" /> Send this file: <input name="userfile" type="file" /> <input type="submit" value="Send File" /> </form>'; if (isset($_FILES["userfile"])) { var_dump($_FILES); } ?>