LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 02-05-2011, 02:22 PM   #1
ps1x0
Member
 
Registered: Jan 2011
Posts: 35

Rep: Reputation: 0
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.

Last edited by ps1x0; 02-05-2011 at 02:54 PM.
 
Old 02-05-2011, 02:35 PM   #2
smoker
Senior Member
 
Registered: Oct 2004
Distribution: Fedora Core 4, 12, 13, 14, 15, 17
Posts: 2,279

Rep: Reputation: 250Reputation: 250Reputation: 250
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.
 
Old 02-05-2011, 02:43 PM   #3
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,159
Blog Entries: 1

Rep: Reputation: 2021Reputation: 2021Reputation: 2021Reputation: 2021Reputation: 2021Reputation: 2021Reputation: 2021Reputation: 2021Reputation: 2021Reputation: 2021Reputation: 2021
Or you can add in httpd.conf:
Code:
AddType application/octet-stream .txt
Regards
 
Old 02-05-2011, 02:54 PM   #4
ps1x0
Member
 
Registered: Jan 2011
Posts: 35

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by bathory View Post
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.

Last edited by ps1x0; 02-05-2011 at 03:07 PM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Copy the contents of a txt file to other txt files (with similar names) by cp command Aquarius_Girl Linux - Newbie 7 07-03-2010 12:54 AM
How can read from file.txt C++ where can save this file(file.txt) to start reading sam_22 Programming 1 01-11-2007 05:11 PM
Downloadable ISO / file of LQ forum ? markraem LQ Suggestions & Feedback 3 06-06-2006 09:10 AM
How to allow .BIN to be downloadable via http Spnets *BSD 0 07-24-2004 06:23 PM
Making An Http File Server? AFI_Flame Linux - Software 4 06-06-2004 10:33 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 08:57 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration