Board index   FAQ   Search  
Register  Login
Board index PHP PHP General

Check to see if a file exists on server.

General discussions related to php

Moderators: macek, egami, gesf

Postby tryton » Thu Aug 21, 2003 9:16 am

Try using the fopen statement. For example,

Code: Select all
$fp = fopen("filename", "r");
if($fp) { File exists. } else { File does not exist. }
User avatar
tryton
New php-forum User
New php-forum User
 
Posts: 49
Joined: Wed Jul 09, 2003 8:25 am
Location: Joze

Postby Joan Garnet » Thu Aug 21, 2003 10:41 am

There's a specific function for doing that:
http://es.php.net/manual/en/function.file-exists.php
User avatar
Joan Garnet
Moderator
Moderator
 
Posts: 387
Joined: Sat Aug 03, 2002 2:56 am
Location: Mars

Re: Check to see if a file exists on server.

Postby swirlee » Thu Aug 21, 2003 11:32 am

danofpaco wrote:Is there a way to check wether or not a file exists on a server, and return a boolean?


Please check the documentation next time.
User avatar
swirlee
Moderator
Moderator
 
Posts: 2272
Joined: Sat Jul 05, 2003 1:18 pm
Location: A bunk in the back


Return to PHP General

Who is online

Users browsing this forum: Yahoo [Bot] and 2 guests

Sponsored by Sitebuilder Web hosting and Traduzioni Italiano Rumeno and antispam for cPanel.