#38308 [NEW]: is_file and file_exists return false for uploaded file
| From: | fartal at lanbyte dot com | Date: | Thu, 03 Aug 2006 09:29:00 +0000 |
| Subject: | #38308 [NEW]: is_file and file_exists return false for uploaded file | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-100264@lists.php.net to get a copy of this message | ||
From: fartal at lanbyte dot com
Operating system: windows 2000
PHP version: 4.4.3
PHP Bug Type: Filesystem function related
Bug description: is_file and file_exists return false for uploaded file
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 bug report at http://bugs.php.net/?id=38308&edit=1
--
Try a CVS snapshot (PHP 4.4): http://bugs.php.net/fix.php?id=38308&r=trysnapshot44
Try a CVS snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=38308&r=trysnapshot52
Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=38308&r=trysnapshot60
Fixed in CVS: http://bugs.php.net/fix.php?id=38308&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=38308&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=38308&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=38308&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=38308&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=38308&r=support
Expected behavior: http://bugs.php.net/fix.php?id=38308&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=38308&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=38308&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=38308&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=38308&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=38308&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=38308&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=38308&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=38308&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=38308&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=38308&r=mysqlcfg