I am using the following asp.net code to stream word documents.
Response.Clear();
Response.ContentType = "application/vnd.ms-word";
Response.AddHeader("content-disposition", "attachment;filename=\"" + Letter.WordFileName.Replace(" ", "%20").Replace("&", "And") + "\"");
Response.BinaryWrite(Letter.WordDocument.ToMSWordDocument());
Response.End();
Last week, I started to receive the following message while trying to stream files in ie8
Unable to download [file] from [server]
Unable to open this Internet site. The requested site is either unavailable or cannot be >found. Please try again later.
I do not get the error after updating to ie9 but most of my users still use ie8. I have a feeling this might be related to a windows security patch, but I have not found anything like this from my Google searches.
Here is some more information:
Response Header
HTTP/1.1 200 OK Cache-Control: private, no-cache="Set-Cookie" Content-Type: application/vnd.ms-word Server: Microsoft-IIS/7.5 Set-Cookie: .ASPXAUTH=74B339B8F7578C646C5ABEB1DD798B73409F51EBE28A1EE3CA0E9B16CDA93C1A3B81CA6A82ABABF940A3E828B5B1D7DE503940AD669CD435E28DE36848A706ECA2BF0CAAB408263DFA22166CB796FEAE27A96950DE37A70619C2F59D9C138F39749DC814D41F9839F3414AEDDA7A3A26F5DA92EFAF09BC8C965F61E02DB68B94D8D43C3201528B601896108B0A30B3CDEDF389F3C3D463E2163596186BFE6BADB83DB635193CDE01DA06E0CB3D0F9FAC1C392DA5E30052AD530B803FA92FD72EA7D768B5BB1505BA26B566AED1DCDE7E5423143803434F2C32572427CD6B68A49126E7084947CC52CE315FAC9A94DA1EE4BF765A0F4D2277679F41F6F19275B0067C6223517A959811A24B36C882F9F6D76B1C408B109DBA33991FDC79517A4E7B4C24DEC38E00FA2C7CFBA5566067017CBF34C71D2CC33605A621277C5E6D3E34F45529536140841A0B98720F7129CF49EDB4D3C61553865EE1A332B4273A674FED651FA7525ED6BF180A578B3C0BA0422C40B4C09663BFA3D6E4DD69171C4B2A558506E1B1AFA5788C37EEB8BB2052BA02C91DB14CA0DC5D12F56E62A3016982521480CA104DC3E7451CC92F89003BDE64378961CB8D40753D4031D1CB5A8B78BE6004B97E2128F8ABE584B7961CECF4983C54A48B5E0AB662ECAFF4E04E984C663EA2CBE4C2161FB1D074B06F297378BA15F36927870735833076BB2E43E60BE83E82EBB0138290A761803535BF0590C22F6AAC01397E67C5FE52A3AB5EBB; path=/ content-disposition: attachment;filename="Septa%20Roberts%20Compound%2020111226[1].doc" X-AspNet-Version: 4.0.30319 X-Powered-By: ASP.NET Date: Tue, 10 Jan 2012 16:07:51 GMT Content-Length: 147456
Try replacing
Response.End();
with
Response.Flush
CompleteRequest()
in the end of the code block (refer here and there for extra info). Maybe the Response redirect has some kind of trouble and it causes your server's response to fail on browser's eyes.
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