Check to see if a file exists on server.

General discussions related to php

Moderators: macek, egami, gesf

User avatar
New php-forum User
New php-forum User
Posts: 49
Joined: Wed Jul 09, 2003 8:25 am
Location: Joze

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
Joan Garnet
Posts: 387
Joined: Sat Aug 03, 2002 2:56 am
Location: Mars

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

There's a specific function for doing that:

User avatar
Posts: 2272
Joined: Sat Jul 05, 2003 1:18 pm
Location: A bunk in the back

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.

Return to “PHP General”

Who is online

Users browsing this forum: No registered users and 3 guests