Reply to Re: file_exists does not work

Your name:

Reply:


Posted by lvaro G. Vicario on 08/13/07 13:23

Bob Sanderson escribió:
> 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?

You're trying to find out whether a URL points to a valid resource
without actually fetching the file. Are you sure that's what you really
need? If you just need to get a file from you own server you don't need
to play with HTTP: feed file_exists() with a file system path:

$file=$_SERVER['DOCUMENT_ROOT'].'/images/dwg_images/5005/5005001_.pdf';

if( file_exists($file) ){
// Whatever
}



--
-+ http://alvaro.es - Álvaro G. Vicario - Burgos, Spain
++ Mi sitio sobre programación web: http://bits.demogracia.com
+- Mi web de humor austrohúngaro: http://www.demogracia.com
--

[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

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