Click here to get back home

file_exists() returns false

 HomeNewsGroups | Search | About
 comp.lang.php    Post an article   get this group's latest topics as an RSS feed add this group's latest topics to your My MSN content add this group's latest topics to your My Yahoo content
Subject Author Date
file_exists() returns false damezumari 06-04-2008
Posted by damezumari on June 4, 2008, 9:45 am
Please log in for more thread options
$file = 'C:\Documents and Settings\Michael\Escritorio\Elvis\test.txt';

file_exists($file)
and
file_exists('"'.$file.'"')

both return false although the file does exist on the user's machine.

What am I doing worng?

Kind regards,

Jan Nordgreen

Posted by damezumari on June 4, 2008, 10:03 am
Please log in for more thread options
I have been told that file_exists() looks for files on the server, not
on the user's machine.

If that is correct the question then is: how do I check if a file
exist on the user's machine? Or can't it be done?

Kind regards,

Jan Nordgreen

Posted by Peter H. Coffin on June 4, 2008, 10:32 am
Please log in for more thread options
On Wed, 4 Jun 2008 07:03:23 -0700 (PDT), damezumari wrote:
> I have been told that file_exists() looks for files on the server, not
> on the user's machine.
>
> If that is correct the question then is: how do I check if a file
> exist on the user's machine? Or can't it be done?

That'd be up to the possibly-faulty implementation of /Java(script)?/.

--
Crowds want to beat, journalists deserve to be beaten. Where lies
the problem?
-- Lars Syrstad

Posted by Rik Wasmus on June 4, 2008, 11:48 am
Please log in for more thread options
Peter H. Coffin wrote:
> On Wed, 4 Jun 2008 07:03:23 -0700 (PDT), damezumari wrote:
>> I have been told that file_exists() looks for files on the server, not
>> on the user's machine.
>>
>> If that is correct the question then is: how do I check if a file
>> exist on the user's machine? Or can't it be done?
>
> That'd be up to the possibly-faulty implementation of /Java(script)?/.

Java (applets) can, I suspect Flash can too, javascript only if a
particular UA manufacturer has erred beyond believe.
--
Rik Wasmus
...spamrun finished

Posted by sheldonlg on June 4, 2008, 12:40 pm
Please log in for more thread options
Rik Wasmus wrote:
> Peter H. Coffin wrote:
>> On Wed, 4 Jun 2008 07:03:23 -0700 (PDT), damezumari wrote:
>>> I have been told that file_exists() looks for files on the server, not
>>> on the user's machine.
>>>
>>> If that is correct the question then is: how do I check if a file
>>> exist on the user's machine? Or can't it be done?
>>
>> That'd be up to the possibly-faulty implementation of /Java(script)?/.
>
> Java (applets) can, I suspect Flash can too, javascript only if a
> particular UA manufacturer has erred beyond believe.

I'm curious. How does type="file" work? That allows a directory search
of the user's machine. Of course, it it totally under the user's
control, so no security breach, but what mechanism is used to get the data?

Similar ThreadsPosted
where to look when mysql_query returns false? December 8, 2004, 9:46 pm
move_uploaded_file returns false March 13, 2008, 3:48 pm
file_exists alway returns false November 9, 2004, 3:22 am
Re: newbie: mail() returns false March 10, 2008, 1:31 am
define alyas returns a false November 2, 2008, 11:28 am
is_file() returns false for uploaded files? April 18, 2006, 5:54 am
isset returns true when it should return false April 27, 2007, 3:01 pm
Class method returns both TRUE and FALSE at the exact same time!! July 24, 2006, 5:49 pm
fgetcsv returns false in dynamic read vs. hard-coded read ?? September 20, 2006, 1:17 pm
ftp_nlist returns false for empty directory instead of empty array February 15, 2006, 1:10 pm

Our other projects:

Art Dolls, Fairies and Mermaids - Sunnyfaces.net

Roy's Linux, Programming and Search Engines messages

1-Script XML SitemapXML Sitemap