#37118 [Opn->Fbk]: is_file returns false for uploaded file
ID: 37118
Updated by: tony2001@php.net
Reported By: kimmo dot laine at zarga dot net
-Status: Open
+Status: Feedback
Bug Type: Filesystem function related
Operating System: Windows 2003 IIS 6
PHP Version: 5.1.2
New Comment:
Please try using this CVS snapshot:
http://snaps.php.net/php5.2-latest.tar.gz
For Windows:
http://snaps.php.net/win32/php5.2-win32-latest.zip
Previous Comments:
------------------------------------------------------------------------
[2006-04-24 06:18:11] kimmo dot laine at zarga dot net
adding var_dump($_FILES['myfile']['tmp_name']); to the code
echoes the following:
string(27) "C:\WINDOWS\TEMP\phpAC2A.tmp"
------------------------------------------------------------------------
[2006-04-22 17:42:51] tony2001@php.net
What do you get if you add var_dump($_FILES['myfile']['tmp_name']); to
your code?
------------------------------------------------------------------------
[2006-04-18 09:48:25] kimmo dot laine at zarga dot net
Description:
------------
Running IIS 6 on Windows 2003 server.
After an update to the most recent version of php 5.1.2, for some
reacon a function handling uploaded using is_file stopped working.
is_file failed for existing files. I fixed it by changing is_file to
file_exists, then it worked again. Prior to the update, in the older
version, presumably it was 5.0.1, is_file worked just fine without
problems.
Reproduce code:
---------------
<?php
echo 'is_file:' . (is_file($_FILES['myfile']['tmp_name']) ?
'true' :
'false');
echo 'file_exists:' . (file_exists($_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:truefile_exists:true
Actual result:
--------------
is_file:falsefile_exists:true
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=37118&edit=1
Thread (6 messages)