How can i redirect to a file download rather than showing the content i want to redirect to a download.
thanks in advance
Printable View
How can i redirect to a file download rather than showing the content i want to redirect to a download.
thanks in advance
response.redirect "filedownlod.html"
if its not response,
then its request, i forgot which one it is :)
Response.Redirect will show you the content of the page, which is all okay if you want to display a different page but I want to download a file. e.g. Response.Redirect "http://www.somewhere.com/setup.exe"
Doesn't
Response.Redirect("setup.exe") work?
I think we covered this about a week ago.. If the user's PC is setup to view the file in IE, it will. You can't force it to stop. The user can alternately right click on the link and download the target but you can't force a file to download if IE thinks it can display it.
and the moral of the story is...USE ZIP FILES!!!
Actually I think your snippet should work Sail.. I don't think any browsers are set up to actually display an .exe so it will ask open or download. If they choose open, it will download then run the file.
I'm not sure why it's doing it, but all i get is the contents of the EXE file rather than a download dialog box. Could it be that i had already sent content to the page so the headers would have allready arived at the browser.
Yeah, check the MIME type being sent in the Http headers. It would usually default to text/html or text/plain if you haven't manually set it.