I’m trying to solve the following problem:
I have a download button that when clicked, redirects to a file for download.
Example:
Response.Redirect(“http://www.example.com/data/file1.zip”);
when this button is clicked you get a menu in that you can press OK to download.
But if I have the following:
Response.Redirect(“http://www.example.com/data/textfile.txt”);
I get a piece of text instead. I don’t want this behavior.
How can I make a menu pop all cases when you click to download the file.
I tried the following:
Response.ContentType = "application/octet-stream";
Response.Redirect("http://www.example.com/data/" + filename);
But if I click on it I still just get the contents of the txt in the browser. Is there any way to check if this mime type is actually being applied?
You need to set the response type,
octet-stream should force the user to open or save the file
something like