开发者

IE7/8 ignoring file download request in popup

I'm using Silverlight and I need to allow the user to save some dynamically genereated files.

For PDF files I created an http handler and it works just fine when I open it in a popup window.

For Excel files I tried every combination of Content-type and Content-disposition but IE8 refuses to open the file. With Fiddler I can see the get and there's a very short display of an IE window but it closes straight away.

I can't see any error message anywhere and I can't 开发者_C百科find any other description of the issue. IE7 exhibits the same behaviour.

I tried Content-type = application/vnd.ms-excel, application/unknown, application/octet-stream and for for Content-disposition I tried inline and attachment.

PS: I can't use the SL built-in save dialog because it requires the context to be within a user action and I generate the file asychronously on the server.


Sounds like automatic prompting for downloads is disabled. See this description on how to enable automatic prompting. Enabling automatic prompting worked for me (situation: silverlight app uses Window.Navigate to open a popup to a generic handler that generates an excel file, with content-disposition: attachment, which worked fine in FF, but not in IE8). As this post is already pretty old, I'm curious if you found a better way to solve this!


You should be using Content-Disposition: attachment

Have you tried on another client? My guess is maybe that Office is trying to get kicked off and is failing.

Alternatively, it's possibly related to http://blogs.msdn.com/ieinternals/archive/2009/10/02/Internet-Explorer-cannot-download-over-HTTPS-when-no-cache.aspx

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜