#32446 [Opn->Bgs]: HTTP file upload notices
| From: | iliaa@php.net | Date: | Fri, 25 Mar 2005 00:02:30 +0000 |
| Subject: | #32446 [Opn->Bgs]: HTTP file upload notices | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-75829@lists.php.net to get a copy of this message | ||
ID: 32446
Updated by: iliaa@php.net
Reported By: tnields at aamc dot org
-Status: Open
+Status: Bogus
Bug Type: Output Control
Operating System: Apache/2.0.46 (Red Hat).
PHP Version: 5.0.3
New Comment:
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to
report
a bug at http://bugs.php.net/how-to-report.php
this is because your PHP was compiled with debugging symbols.
Previous Comments:
------------------------------------------------------------------------
[2005-03-24 20:24:08] tnields at aamc dot org
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 this bug report at http://bugs.php.net/?id=32446&edit=1