|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #18959 Non-existant file uploads return success error message
Submitted: 2002-08-17 16:52 UTC Modified: 2002-09-03 18:26 UTC
Avg. Score:5.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:0 (0.0%)
From: mikeharris at rogers dot com Assigned:
Status: Not a bug Package: HTTP related
PHP Version: 4.2.2 OS: Windows 98 SE
Private report: No CVE-ID: None
 [2002-08-17 16:52 UTC] mikeharris at rogers dot com
PHP v4.2.2 w/ Apache 1.3.22 on Windows 98 SE.

Re: Handling File Uploads

You can enter a path/filename that doesn't exist (or even gibberish) into a HTML <INPUT TYPE="file"> control and PHP will assign the corresponding $_FILES['foo']['error'] variable a value of 0, even though 0 indicates a successful upload.

Since the file didn't exist on the client machine, it couldn't possibly be uploaded to the server, but PHP creates a 0 byte temp file anyways.  Wouldn't it be more appropriate to assign the non-existant file upload an error code of 4, since nothing was actually uploaded?


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2002-09-03 18:26 UTC]
How could PHP know if the file exists in the users machine?
This is not bug but expected behaviour.

PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Mon Sep 27 23:03:36 2021 UTC