Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Download Files

Status
Not open for further replies.

harrysdad

Programmer
May 30, 2002
53
GB
Is there a simple way of replicating the Right Click-> Save Target As behaviour in a link, so that rather than opening a file in a browser it prompts for download to their local machine when the link is clicked?
 
You can give the file some weird file extension. Then the browser won't know what to do with it and will download it.

Problem is that you need to get the user to change the file extension back again for it to work properly.

So perhaps not a great idea.

I would imagine it can be done by changing the server config though.

 

>> I would imagine it can be done by changing the server config though.

Yup - if you change the MIME type for the relevant file extension to be some generic binary type, it should prompt the user.

Hope this helps,
Dan
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top