Click to See Complete Forum and Search --> : php to local PC...


aaronking
January 17th, 2008, 09:00 PM
Hello,

Is there a way of using php to create a file on the users computer?

eg. I have a page and when I view that page (page.php) make it create a file on the users local PC (c:\file.txt) and add some text into it.

Is there a way of doing this using php?

Thanks.

PeejAvery
January 18th, 2008, 08:20 AM
No, you cannot. That would be a huge breach of security. Think about a website being able to write anything they want to a client computer? Viruses would be everywhere.

You will have to initial a download. Take a look at my [url=http://www.peejavery.com/coding/php/download.php]force download[/php] script. You can create the handler for PHP extensions.