|
Posted by Bob Sanderson on 08/13/07 12:59
Rik <luiheidsgoeroe@hotmail.com> wrote in
news:op.twzz8gznqnv3q9@metallium:
> On Mon, 13 Aug 2007 14:36:19 +0200, Bob Sanderson
> <news@LUVSPAMbobsanderson.com> wrote:
>
>> This is my code:
>>
>> if (file_exists($Fname))
>
>> http://server1:8080/images/dwg_images/5005/5005001_.pdf does not
>> exist
>
>
> From the manual:
>
> File_exists:
> <http://nl3.php.net/file_exists>:
> "As of PHP 5.0.0 this function can also be used with some URL
> wrappers. Refer to Appendix O, List of Supported Protocols/Wrappers
> for a listing of which wrappers support stat() family of
> functionality."
>
> HTTP wrapper:
> <http://nl3.php.net/manual/en/wrappers.http.php>
> Table O.2. Wrapper SummaryAttribute Supported
> Restricted by allow_url_fopen Yes
> Allows Reading Yes
> Allows Writing No
> Allows Appending No
> Allows Simultaneous Reading and Writing N/A
> Supports stat() No <---------------------------
> Supports unlink() No
> Supports rename() No
> Supports mkdir() No
> Supports rmdir() No
>
> Ergo: file_exists does not play nice with http:// wrappers. If you
> want to verify wether an URL exists, use fsockopen()(HEAD request),
> or CURL.
Thanks for the reply but I'm a beginner with PHP and frankly, don't
understand any of what you said. Is there another, simple way to
determine if a file exists?
Navigation:
[Reply to this message]
|