views:

101

answers:

5

How can I cause Firefox to ignore the Content-Disposition: attachment header? I find it absolutely annoying that I can't view an image in the browser, because it asks me to download it.

I don't want to download the file, I just want to view it in the browser. If the browser doesn't have a plugin to handle it, then it should ask to download.

E.g. I have Adobe Acrobat Reader installed as a plugin for Firefox. I click a link to a PDF, and it asks me to save it, when it should open in the browser using the plugin. This is the behaviour if the server does not send the Content-Disposition: attachment header in the response.

Firefox 3.6.6 Windows XP SP3

A: 

Well, that's the purpose of disposition type "attachment".

The default behavior (when the header is absent) should be to display in-line.

Maybe there's a configuration problem in your browser, or the Reader plugin?

Julian Reschke
Nah, images are handled by Firefox directly; without a plugin. What I'm saying is I don't want to download it, I just want to see it.The biggest reason for this is to prevent excess windows from opening.Normally, I click a link, see the file. But in some cases (like download this image) open a new window "Your download will begin shortly" which opens a Firefox dialog (Yes, I know I can skip this) so I choose "open with", the file downloads, then the program opens. Count these up. That's 5 windows for what in all other cases is 1.
Again: check that your reader plugin is configured properly (try another machine?). Check the HTTP Trace (is the header really present). Optimally, supply a test case that demonstrates the problem.
Julian Reschke
The *site* is adding the header to say *it* wants you to download it. It's perfectly reasonable to want the browser to let you override this (just like it does for thousands of other actions: open in new tab, block javascript, etc etc).
Draemon
A: 

Go to Tools > Options > Applications and change the dropdown option Always Ask associated with a certain content type to the default application to your taste.

BalusC
But he wants it to open directly in the browser, not an external application.
Draemon
A: 

You could write a firefox extension that removes the disposition header for PDF files. This would be a fairly simple extension.

Mike
A: 

For PDFs there is an addon called PDF-Download which overrides any attempt to download a PDF and lets the user decide how they want it downloaded (inline, save, external, etc). You could probably modify it to work for other filetypes too.

Mr. Shiny and New
A: 

The "Open in browser" extension is useful for formats supported natively by the browser, not sure about PDF.

Nickolay
I already found this extension before you answered, but that's what i finally did.
LatinSuD