Jump to content

making file available for download instead of opening in browser?


Recommended Posts

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.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?

Thanks!
This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

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.