R4cOOn
R4cOOn

Reputation: 2575

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 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.

Upvotes: 2

Views: 1425

Answers (2)

YuriW
YuriW

Reputation: 429

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!

Upvotes: 1

EricLaw
EricLaw

Reputation: 57085

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

Upvotes: 0

Related Questions