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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to Download files without right clicking

Status
Not open for further replies.

balin

Technical User
Dec 6, 2002
89
0
0
AU
I want users to be able to click on a link or a button to start a file download. Then have the 'save as' dialog do it's thing etc.

I know right click and 'save taget as' is easy but I use the 'moron' principle and don't want to have to educate users.

JON
 
It will entirely depend, on the client browser, whether it displays the download dialog, or just tries to open the file. Usually, a link like this:

<a href="\somefolder\somefile.ext">Download</a>

will prompt the dialog to appear, unless the client browser has a plugin that can open the file straight into the browser.

However you could use a server-side language to serve the file, and the headers explicitly to have the browser show the download dialog. but of course you'll need to go the forum of the server-side language of choice for a more detailed explanation on how to do it.

----------------------------------
Ignorance is not necessarily Bliss, case in point:
Unknown has caused an Unknown Error on Unknown and must be shutdown to prevent damage to Unknown.
 
OK Understand. My problem is I'm making spreadsheets available for download and they do open up in the browser window.

This is where the user gets confused.

I had the files open in a frame but the spreadsheet menu toolbar is not visible so the user can't do a 'save as'. Why is that ??

Sounds like the server side solution is more foolproof.
JON
 
Why not just zip the files? The browser should prompt for download then.
If you need to zip on the fly, there are PHP scripts available to do that.
 
I think I am onto an Asp solution.

Thanks everyone.

JON
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top