php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #32446 HTTP file upload notices
Submitted: 2005-03-24 20:24 UTC Modified: 2005-03-25 01:02 UTC
From: tnields at aamc dot org Assigned:
Status: Not a bug Package: Output Control
PHP Version: 5.0.3 OS: Apache/2.0.46 (Red Hat).
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem:
39 - 27 = ?
Subscribe to this entry?

 
 [2005-03-24 20:24 UTC] 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)
    }
  }
}

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2005-03-25 01:02 UTC] iliaa@php.net
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.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Mon Jun 17 16:01:29 2024 UTC