php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #16747 Empty file upload field results in "No file uploaded in Unknown on line 0" warn
Submitted: 2002-04-23 06:24 UTC Modified: 2012-11-10 16:22 UTC
From: hannes dot dorn at ibit dot at Assigned: rasmus (profile)
Status: Closed Package: Output Control
PHP Version: 4.2.0 OS: Windows 2000 SP2, Apache 1.3.22
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:
35 + 7 = ?
Subscribe to this entry?

 
 [2002-04-23 06:24 UTC] hannes dot dorn at ibit dot at
maybe this is only a config issue in php.ini

test.htm:
<html>
<body>
<FORM METHOD="POST" ACTION="test.php" NAME="form" enctype="multipart/form-data">
    <INPUT TYPE="file" NAME="admin_field_image_big_row1" MAXLENGTH="102400" SIZE="5" ACCEPT="image/*">
    <input type="submit" name="submit" value="test">
</form>
</body>
</html>

test.php
<?php
foreach( $GLOBALS[ "HTTP_POST_VARS" ] as $sName => $sValue )
    echo "$sName = $sValue<br>";
?>

--> Outputs warning No file uploaded in Unknown on line 0

Thanks,
Rasty

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2002-04-23 18:29 UTC] sniper@php.net
Not a bug but expected behaviour. It's changed to E_NOTICE
level now in CVS (for both HEAD and upcoming 4.2.1 release)

Just set your error_reporting level.

--Jani

 [2002-06-06 04:06 UTC] irik at irik dot org
If the development of PHP were a democracy (and it's not far off, I reckon :), I would vote (and maybe even campaign) to have this notice removed.  Whether or not the user chooses to upload a file or is required to is a matter of application design and the sole responsibilty of the developer to address.  What if a file upload is designed to optional?  Why do I need to change the error reporting level on the server in order to suppress on Notice that is if fact completely useless to both the developer and the user.  What benefit is it to the developer or the administrator to have notice in the logs that the user did not upload a file in a provided file box?

I vote to drop the "Notice" and let it go.

Irik
 [2002-06-06 04:19 UTC] sesser@php.net
This bug has been fixed in CVS. You can grab a snapshot of the
CVS version at http://snaps.php.net/. In case this was a documentation 
problem, the fix will show up soon at http://www.php.net/manual/.
In case this was a PHP.net website problem, the change will show
up on the PHP.net site and on the mirror sites.
Thank you for the report, and for helping us make PHP better.


 [2002-07-16 19:03 UTC] m at balieu dot net
I fully support the dropping of the "Notice".

Balieu
 [2004-10-13 16:54 UTC] vitek at 4rome dot ru
I am using php5.0.2 on a Linux platform and I am having this bug, too. It is annoying (a notice appears, I also cannot send any headers) and I really don't want to develope with error_reporting level different from E_ALL as well as using output bufferring just to avoid a problem with headers.

Please indicate if it is a strange behaviour to php5.0.2 or this issue hasn't been treated yet in this lovely version of php. I hope most of developers would agree that it IS more a bug rather than a feature (even if it is represented as a feature).
 [2010-09-19 05:40 UTC] ga972 at yahoo dot com
I am using PHP 5.3.3 and we are still seeing this error.  If it was submitted in the snapshot in 2002 did someone put this bug back or was it just never committed?
 [2012-01-19 17:06 UTC] ava3ar at gmail dot com
In 5.4 this bug seems to be back
 [2012-11-10 16:00 UTC] 7894561230 at list dot ru
PHP 5.4.8 - this bug is present again, please fix it. It was not here in 5.3.x.
 [2012-11-10 16:22 UTC] rasmus@php.net
If you look at the PHP 5.4.x code you will see that notice in main/rfc1867.c but 
it looks like this:

#if DEBUG_FILE_UPLOAD
    sapi_module.sapi_error(E_NOTICE, "No file uploaded");
#endif

DEBUG_FILE_UPLOAD is only turned on if you build a DEBUG version of PHP.
 [2012-11-10 16:22 UTC] rasmus@php.net
-Assigned To: +Assigned To: rasmus
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Mar 28 18:01:29 2024 UTC