Page 1 of 1

Creating Files !

Posted: Mon Feb 16, 2004 2:33 am
by phpbeginer
Hi,
This is me again..

Is it possible to let php code writes on the client side.. I've written a code which asks users to fill up some fields and then the code should creates a file with the data they filled under their c: drive. What happened to me, the data were filled ok but the file was created under the server c: drive?


I hope the question is clear! and please ask for any clarifications if requires..

Regards.

Posted: Mon Feb 16, 2004 2:58 am
by phpbeginer
Please, I need your urgent help....

Posted: Mon Feb 16, 2004 3:31 am
by markl999
You can't write direct to a clients harddrive, this would be a Very Bad Thing[TM] if you could.
What you can do though is create the file on the server and offer that file as a download to the client (so a box pops up saying Open, Save Cancel etc..). If this is ok then see http://php.net/header around the line starting with "If you want the user to be prompted to save the data you are sending...."

Posted: Mon Feb 16, 2004 7:38 am
by phpbeginer
Yes, it is a bad thing to write on the client machine! That would make hacking very easy through PHP ;)

I Think what you suggested is really what I need, I just finished writing the batch file that will ask the user about some information and store it in his harddrive. I will use the download link to allow user run the batch from his side...

Thanks a lot Mark..