I use ASP.NET with web forms, something that should be really easy is driving me crazy, similar questions have been asked but none of them helped me, IE refuses to download my files.
Things to notice:
This is my code:
Response.ClearHeaders();
Response.ClearContent();
Response.ContentType = "Application/pdf";
Response.AddHeader("Content-Disposition", "attachment; filename=" + fileName);
Response.BinaryWrite(buffer);
Response.End();
These are the headers I got from IE:
Key Value
Response HTTP/1.1 200 OK
Cache-Control private
Content-Type Application/PDF
Server Microsoft-IIS/7.5
Content-Disposition attachment; filename=myfile.pdf
X-AspNet-Version 4.0.30319
X-Powered-By ASP.NET
Date Fri, 10 Apr 2015 22:44:40 GMT
Content-Length 691892
UPDATE
It seems like this is a server configuration issue because the same code will work fine in my production server but not in my development server. So my client won't complain about this, anyway I want to fix it in my development environment, as soon as I have time I'll investigate a little more, if I find a solution I'll post it here.
Open Internet Explorer, select the Tools button, and then select View downloads. In the View Downloads dialog box, select Options in the lower-left. Choose a different default download location by selecting Browse and then selecting OK when you're done.
This error means you don't have permission to download the file. To fix the error, contact the website or server owner, or try to find the file on a different site. This error means you don't have permission to download this file from the server. To fix, go to the website where the file is hosted.
We had a similar issue in ie8 the problem is that the file is searched in the cache and is not found. To test this please set Cache-Control : no-cache in your response object.
This is not the exact answer but hope if it can open some ways to find the exact one.
While googling I found this may be due to a security update release by Microsoft for IE.
Microsoft released a security update for IE11 on 8 Jul 14 which has a bug affecting the download.
And here is the Microsoft Connect Link that mention this under active status.
Please share exact solution once you find it.
Cheers!!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With