Page 1 of 1

How to prompt a overwriting file warning ?

Posted: Sun Aug 28, 2005 10:07 pm
by orangeapple
Hi friends,

I have written a php code to save a database backup file on a client's pc. If that file already exists on the client's pc, the file is automatically overwritten. How can i detect if such a file already exists to prevent its overwritting ?

Thanks for your help !

Posted: Sun Aug 28, 2005 10:17 pm
by feyd
how are you downloading the file? Normally, you the OS handles that, since you can't force the download to really happen, just the prompt to download to happen.

Posted: Mon Aug 29, 2005 12:57 am
by orangeapple
with :

fwrite and fclose

i have tried also with :

SELECT * INTO OUTFILE

in both cases, the OS doesn't prompt a warning.
Tks for your help

Posted: Mon Aug 29, 2005 1:10 am
by feyd
neither of those downloads to a client, they are used to write to the local file system. Displaying a prompt for those would involve checking if the file existed before creating them.

Posted: Mon Aug 29, 2005 1:15 am
by orangeapple
so how can i check if the file already exists ?

Posted: Mon Aug 29, 2005 1:18 am
by feyd

Posted: Mon Aug 29, 2005 1:22 am
by orangeapple
Thanks ! :wink: