From: tnields at aamc dot org Operating system: Apache/2.0.46 (Red Hat). PHP version: 5.0.3 PHP Bug Type: Output Control Bug description: HTTP file upload notices
Description: ------------ In release 5.0 this was noted: Changed HTTP file uploads not to throw E_WARNINGs and E_NOTICEs. The error value in the $_FILES global should be used for error handling. (Derick) However in version 5.0.3 on Linux the (it worked on windows) generates the following error on optional file upload fields that are not used: Notice: No file uploaded in Unknown on line 0 Using php5.0.3/Apache/2.0.46 (Red Hat). Reproduce code: --------------- <?php if(isset($_POST['submit'])){ var_dump($_FILES); print "<BR><BR>"; } ?> <form name="myForm" enctype="multipart/form-data" action="<?php echo $_SERVER['PHP_SELF'] ; ?>" method="post"> <table> <tr><td bgcolor="ffffff"><strong>Attachments:</strong></td></tr> <tr><td bgcolor="ffffff"><input type="file" name="file2[]" id="file1" class="button" size="30"></td></tr> <tr><td bgcolor="ffffff"><input type="file" name="file2[]" id="file1" class="button" size="30"></td></tr> <tr><td bgcolor="ffffff"><input type="file" name="file2[]" id="file1" class="button" size="30"></td></tr> <tr><td bgcolor="ffffff"><input type="submit" name="submit"></td></tr> </table> </form> Expected result: ---------------- a var_dump of the $_FILES data struture Actual result: -------------- <br /> <b>Notice</b>: No file uploaded in <b>Unknown</b> on line <b>0</b><br /> </font><br /> <b>Notice</b>: No file uploaded in <b>Unknown</b> on line <b>0</b><br /> </font>array(1) { ["file2"]=> array(5) { ["name"]=> array(3) { [0]=> string(9) "email.xls" [1]=> string(0) "" [2]=> string(0) "" } ["type"]=> array(3) { [0]=> string(24) "application/vnd.ms-excel" [1]=> string(0) "" [2]=> string(0) "" } ["tmp_name"]=> array(3) { [0]=> string(14) "/tmp/phpidlG5j" [1]=> string(0) "" [2]=> string(0) "" } ["error"]=> array(3) { [0]=> int(0) [1]=> int(4) [2]=> int(4) } ["size"]=> array(3) { [0]=> int(13824) [1]=> int(0) [2]=> int(0) } } } -- Edit bug report at http://bugs.php.net/?id=32446&edit=1 -- Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=32446&r=trysnapshot4 Try a CVS snapshot (php5.0): http://bugs.php.net/fix.php?id=32446&r=trysnapshot50 Try a CVS snapshot (php5.1): http://bugs.php.net/fix.php?id=32446&r=trysnapshot51 Fixed in CVS: http://bugs.php.net/fix.php?id=32446&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=32446&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=32446&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=32446&r=needscript Try newer version: http://bugs.php.net/fix.php?id=32446&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=32446&r=support Expected behavior: http://bugs.php.net/fix.php?id=32446&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=32446&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=32446&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=32446&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=32446&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=32446&r=dst IIS Stability: http://bugs.php.net/fix.php?id=32446&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=32446&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=32446&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=32446&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=32446&r=mysqlcfg