You are here: is_file() returns false for uploaded files? « PHP Programming Language « IT news, forums, messages
is_file() returns false for uploaded files?

Posted by Kimmo Laine on 04/18/06 12:54

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 files 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.

<?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>

Submitted a bug report already http://bugs.php.net/bug.php?id=37118 but if
someone has any ideas what's going on here please reply.

--
"ohjelmoija on organismi joka muuttaa kofeiinia koodiksi" -lpk
spam@outolempi.net | Gedoon-S @ IRCnet | rot13(xvzzb@bhgbyrzcv.arg)

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация