#38308 [Com]: is_file and file_exists return false for uploaded file
| From: | michal dot kocarek at brainbox dot cz | Date: | Tue, 17 Feb 2009 10:12:38 +0000 |
| Subject: | #38308 [Com]: is_file and file_exists return false for uploaded file | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-133895@lists.php.net to get a copy of this message | ||
ID: 38308
Comment by: michal dot kocarek at brainbox dot cz
Reported By: fartal at lanbyte dot com
Status: No Feedback
Bug Type: Filesystem function related
Operating System: windows 2000
PHP Version: 4.4.3
New Comment:
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.
Previous Comments:
------------------------------------------------------------------------
[2006-08-25 01:00:00] 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".
------------------------------------------------------------------------
[2006-08-17 14:08:28] tony2001@php.net
Please try using this CVS snapshot:
http://snaps.php.net/php4-STABLE-latest.tar.gz
For Windows:
http://snaps.php.net/win32/php4-win32-STABLE-latest.zip
------------------------------------------------------------------------
[2006-08-03 09:29:00] fartal at lanbyte dot com
Description:
------------
Hi.
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:
---------------
<?php
echo 'is_file:' . (is_file($_FILES['myfile']['tmp_name']) ?
'true' :
'false');?><br><?
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" />
</form>
Expected result:
----------------
is_file:true
file_exists:true
is_uploaded_file:true
Actual result:
--------------
is_file:false
file_exists:false
is_uploaded_file:true
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=38308&edit=1