Jump to content


This topic is now archived and is closed to further replies.


making file available for download instead of opening in browser?

Recommended Posts


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.com/files/myfile.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?


Share this post

Link to post
Share on other sites
for the solution to the above problem: add this to .htaccess:

AddHandler application/x-msexcel .csv

Share this post

Link to post
Share on other sites


Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.