views:

22

answers:

3

Hi all,

I've seen there's a general browser issue when we try to set the Content-Disposition header like "inline;filename=file1.doc": the browser shows the file, but when we try to save the file, the filename property isn't honored and the browser uses the page's name as the file's name (instead of file1.doc). Here's another thread discussing this issue:

http://stackoverflow.com/questions/2562937/downloading-file-from-server-asp-net-to-ie8-content-disposition-problem-with-fi

So my question is: is there really a solution in ASP.NET to make the browsers honor the filename property after sending inline data?

Thanks!

A: 

I would change from inline to attachment. I've recently dealt with something like this for PDFs, and attachment still opens the PDF in the browser, if that is the default that was set on the machine.

Anatoly G
A: 

For reference, this article should help you work around the IE gotchas:

The Content-Disposition Saga: Controlling the suggested file name in the Browser's Save As Dialog

Mark B
A: 

Hi Anatoly/Mark,

First of all, thank you very much for your attention!

I deal with a sort of different file extensions and I'd like to open them in the browser using inline, letting the user choose the option to save the file keeping its original name. Unfortunately, the attachment option isn't appropriate to this scenario.

I'd seen Scott Hanselman's "Content-Disposition Sage..." article before. There's no real solution there...

As far as I've seen there's no reliable/effective solution to work around this browser limitation...

Thanks!