|
Posted by Kimmo Laine on 11/19/05 11:45
"Andy Jeffries" <news@andyjeffries.co.uk> wrote in message
news:pan.2006.04.18.11.54.20.716987@andyjeffries.co.uk...
> 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?
>
Possibly so, but that does not remove the bug. It's a piece of code I've
done some years ago that has worked fine even though a it's not perfect.
Still I'd like to be able to get similar results with is_file and
file_exists regardless of the file being user upload or not.
If this is not a bug but a feature, I'd like to see it explained in the
manual just what it means. ATM, it says in the manual: "is_file -- Tells
whether the filename is a regular file". So, what IS a regular file? What's
the difference between file_exists and is_file because they return different
results. I don't get it. And what bothers me the most is that up to this
point is_file has returned true. Why change it?
--
"ohjelmoija on organismi joka muuttaa kofeiinia koodiksi" -lpk
spam@outolempi.net | Gedoon-S @ IRCnet | rot13(xvzzb@bhgbyrzcv.arg)
[Back to original message]
|