View Full Version : How can i download (open) .txt file? using php

08-27-2007, 07:21 AM
how can i open (download) .txt file , i.e located in my local system by using php coding.when i click some link,it automatically open the .txt file(located on C:/folder/test.txt). please anybody help me.how can i do that.

08-27-2007, 10:26 AM
Well if you didn't want to save the changes to the file, which i'm guessing you are, you could provide a link that will open the text file in the browser.

But if you want to edit it you would need to open the file, read each line and save it to a variable. Then put that variable in a
<textarea> tag with a submit button that saves the changes to the txt file.

go here to learn how to do it http://php.net/manual/en/function.fopen.php