ID: 50749 User updated by: anzenews at volja dot net Reported By: anzenews at volja dot net Status: Bogus Bug Type: PHP options/info functions Operating System: Linux PHP Version: 5.2.12 New Comment:
Then this function is no better than the safe mode, magic quotes and similar fiascos of PHP - useless and will be avoided, at least by me. The purpose of this function is to protect the server from DOS attacks. Does the server need many resources to process the empty files? I would guess not. On the other hand this is very limiting for forms that wish to have many _optional_ file upload input fields (which was how I stumbled across this bug). Anyway, I'll just be careful to choose a host with this "feature" turned off in the future, the same as I did with safe mode. :( Oh, and by the way, turning it on by default in the very first incarnation of this option is not very nice IMHO. It took me quite some time to figure out what is going on since there are almost no pages with this setting described yet. :( Previous Comments: ------------------------------------------------------------------------ [2010-01-15 08:55:11] j...@php.net Of course it does, that's exactly it's purpose: to limit maximum number of uploads. And yes, even "empty" upload is an upload. ------------------------------------------------------------------------ [2010-01-14 13:46:53] anzenews at volja dot net Description: ------------ Setting max_file_uploads limits the number of file input fields on HTML page instead of limiting the number of actually uploaded files. Reproduce code: --------------- <form name="formData" action="" enctype="multipart/form-data" method="post"> <?php for ($i=0;$i<30;$i++) { echo "File ".($i+1).":<br />\n". '<input name="file_'.$i.'" type="file" /><br />'."\n"; }; ?> <input value="OK!" type="submit" /> </form> <pre> <?php var_dump($_FILES) ;?> </pre> Expected result: ---------------- When you upload a single file (in the LAST!!! input box) and hit "OK!", you should see the uploaded file. Actual result: -------------- Instead you see just 20 empty file uploads. (if max_file_uploads is set to 20, as per default) The max_file_uploads setting should never count empty files. ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=50749&edit=1