Re: is_file() returns false for uploaded files?
Available news archives: comp.lang.tcl - comp.lang.python - comp.security.firewalls - sci.crypt - comp.lang.php - comp.lang.javascript
Google
 
Web news.hping.org


comp.lang.php archive

Re: is_file() returns false for uploaded files?

From: Andy Jeffries <news@andyjeffries.co.uk>
Date: Tue Apr 18 2006 - 13:54:18 CEST

On Tue, 18 Apr 2006 12:54:08 +0300, Kimmo Laine wrote:
> 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');
> ?>

For this use, shouldn't you be using is_uploaded_file anyway?

Cheers,

Andy

-- 
Andy Jeffries MBCS CITP ZCE   | gPHPEdit Lead Developer
http://www.gphpedit.org       | PHP editor for Gnome 2
http://www.andyjeffries.co.uk | Personal site and photos
Received on Mon May 1 02:58:44 2006