|  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
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
From: hannes dot dorn at ibit dot at
New email:
PHP Version: OS:


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

<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">

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

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



Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2002-04-23 18:29 UTC]
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.


 [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.

 [2002-06-06 04:19 UTC]
This bug has been fixed in CVS. You can grab a snapshot of the
CVS version at In case this was a documentation 
problem, the fix will show up soon at
In case this was a website problem, the change will show
up on the 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".

 [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]
If you look at the PHP 5.4.x code you will see that notice in main/rfc1867.c but 
it looks like this:

    sapi_module.sapi_error(E_NOTICE, "No file uploaded");

DEBUG_FILE_UPLOAD is only turned on if you build a DEBUG version of PHP.
 [2012-11-10 16:22 UTC]
-Assigned To: +Assigned To: rasmus
PHP Copyright © 2001-2023 The PHP Group
All rights reserved.
Last updated: Wed Oct 04 12:01:25 2023 UTC