|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #38308 is_file and file_exists return false for uploaded file
Submitted: 2006-08-03 09:29 UTC Modified: 2006-08-25 01:00 UTC
Avg. Score:3.9 ± 1.0
Reproduced:9 of 9 (100.0%)
Same Version:5 (55.6%)
Same OS:3 (33.3%)
From: fartal at lanbyte dot com Assigned:
Status: No Feedback Package: Filesystem function related
PHP Version: 4.4.3 OS: windows 2000
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: fartal at lanbyte dot com
New email:
PHP Version: OS:


 [2006-08-03 09:29 UTC] fartal at lanbyte dot com
After uploading a file, functions "is_file" and "file_exists" return false for the temp file

Probably related to "Bug #37118 :is_file returns false for uploaded file" but getting false also with file_exists

Just upgraded to PHP Version 4.4.2 on Windows 2000 server SP4 from 4.3.11 where I found the same error

Reproduce code:
echo 'is_file:' . (is_file($_FILES['myfile']['tmp_name']) ? 'true' :
echo 'file_exists:' . (file_exists($_FILES['myfile']['tmp_name']) ?
'true' : 'false');?><br><?
echo 'is_uploaded_file:' . (is_uploaded_file($_FILES['myfile']['tmp_name']) ?
'true' : 'false');
<form action="<?php echo $_SERVER['PHP_SELF'] ?>"
enctype="multipart/form-data" method="post">
<input type="file" name="myfile" />
<input type="submit" />

Expected result:

Actual result:


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2006-08-25 01:00 UTC] php-bugs at lists dot php dot net
No feedback was provided for this bug for over a week, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
 [2009-02-17 10:12 UTC] michal dot kocarek at brainbox dot cz
I experience this bug as well.

- file_exists returns false (error)
- is_uploaded file returns true (good)
- fopen(..., 'r') works as well as file_get_contents (good)

We have PHP 5.2.8 running on IIS 6.0 on Windows 2003 Server.

I can say that before we upgraded from PHP 5.1.x to PHP 5.2.8, this bug was not there.
PHP Copyright © 2001-2020 The PHP Group
All rights reserved.
Last updated: Sat Feb 29 09:01:28 2020 UTC