LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (https://www.linuxquestions.org/questions/linux-server-73/)
-   -   Making a TXT file downloadable (HTTP) (https://www.linuxquestions.org/questions/linux-server-73/making-a-txt-file-downloadable-http-860916/)

ps1x0 02-05-2011 02:22 PM

Making a TXT file downloadable (HTTP)
 
Hey,

I'm running a webserver and i've uploaded serveral .txt files. I want them to be downloadable...
For example if someone opens:
http://www.example.org/something.txt, to start downloading, not just to open in the browser.

Thnx.

smoker 02-05-2011 02:35 PM

Either you tell people to right click the link and download the file, or you add .zip to the end of the file name so that the browser can't open it. It doesn't have to be .zip, anything that the browser and the server don't understand will do. There is no secret, even if the text file is opened in the browser, it has already been downloaded, so people can save the page if they want.

bathory 02-05-2011 02:43 PM

Or you can add in httpd.conf:
Code:

AddType application/octet-stream .txt
Regards

ps1x0 02-05-2011 02:54 PM

Quote:

Originally Posted by bathory (Post 4249402)
Or you can add in httpd.conf:
Code:

AddType application/octet-stream .txt
Regards

Thanks ;)

Actually I had to add it in the .htaccess file, but it worked.


All times are GMT -5. The time now is 10:27 AM.