Jump to content


Photo

making file available for download instead of opening in browser?


  • Please log in to reply
1 reply to this topic

#1 sploit

sploit
  • Members
  • PipPip
  • Member
  • 12 posts

Posted 08 March 2006 - 11:19 PM

Hiya,

I have a simple script which uploads a CSV file to the server.
It is saved as filename.csv.
I have a direct link to this uploaded file such as <a href="http://www.myserver....e.csv">Download CSV File</a>

When I click the link, it gives me an option to download the file.


Now I uploaded this same script on another server.
On clicking the "Download CSV File" link on this server, it opens the CSV file in the browser instead of giving me the download box.

Can I set up the .htaccess file in some way on the second server that would allow the CSV file to be downloaded instead of opened in the browser?

Thanks!

#2 sploit

sploit
  • Members
  • PipPip
  • Member
  • 12 posts

Posted 09 March 2006 - 03:57 PM

for the solution to the above problem: add this to .htaccess:

AddHandler application/x-msexcel .csv





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users