Reply to Re: file_exists does not work

Your name:

Reply:


Posted by Rik on 08/13/07 12:42

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.
--
Rik Wasmus

[Back to original 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

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