Can you force the "Save As" window for a download?

JavaScript and client side scripting.

Moderator: General Moderators

Post Reply
simonmlewis
DevNet Master
Posts: 4435
Joined: Wed Oct 08, 2008 3:39 pm
Location: United Kingdom
Contact:

Can you force the "Save As" window for a download?

Post by simonmlewis »

We have a 'download' link that lets someone download an image.
Right now it is just linking to the image in the browser, and so the user then has to right click....etc....

Is there a way to force it straight to 'Save As' ???
Love PHP. Love CSS. Love learning new tricks too.
All the best from the United Kingdom.
User avatar
Weirdan
Moderator
Posts: 5978
Joined: Mon Nov 03, 2003 6:13 pm
Location: Odessa, Ukraine

Re: Can you force the "Save As" window for a download?

Post by Weirdan »

Browser relies on mime type the server provides. Generally, if it doesn't know how to handle the file itself it proposes user to either select the application or save the file. Mime type set to 'application/octet-stream' is what many people use as it's too generic for browser to find suitable plugin to handle.

What does this have to do with javascript?
simonmlewis
DevNet Master
Posts: 4435
Joined: Wed Oct 08, 2008 3:39 pm
Location: United Kingdom
Contact:

Re: Can you force the "Save As" window for a download?

Post by simonmlewis »

It might have a lot to do with Javascript, as I thought it would take that to make this work.

How do I use "application/octet-stream"?
Love PHP. Love CSS. Love learning new tricks too.
All the best from the United Kingdom.
Post Reply