views:

57

answers:

1

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.

A: 

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

EricLaw -MSFT-
FF works perfectly fine. And as i said I did use `Content-Disposition: attachment` (and I tried `inline` as well for good measure). I noticed the `No-Cache` because when I set it PDF wouldn't work neither.I think my option's going to be to use a hidden `iframe`. Looks like that's how other professional sites trigger downloads.
R4cOON