[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: Firefox does not open .PNG files anymore

Marcelo Magno T. Sales wrote:
> Em Sáb 14 Fev 2009, Konstantin Svist escreveu:
>> Marcelo Magno T. Sales wrote:
>>> Hi,
>>> Since recently, possibly after the upgrade to 3.0.6, Firefox does
>>> not open .PNG files anymore. When I click a link which points to a
>>> .PNG file, Firefox asks for an external application to open the
>>> file instead of opening it directly in Firefox. How do I get the
>>> old behavior back?
>>> Thanks,
>>> Marcelo
>> I've seen this happen, too. I'm pretty sure this is because of
>> incorrectly configured websites. A website is supposed to send a
>> header telling the browser what kind of file it's sending (in this
>> case, image/png) - if it doesn't send the right one, the browser
>> offers the user to download the file.
> I'm seeing this in KDE's bugzilla web site (among others), which I have 
> always used without this problem. And Firefox correctly identify the 
> file as "PNG image" in the open file dialog. It seems this is not the 
> cause of the problem. Also, the problem is just with PNG files, but not 
> other types of image files.
> []'s
> Marcelo

KDE's bugzilla -- do you mean when downloading an attachment? Because if
that's the case, then it's supposed to download, not display. Please
give an example page which exhibits this behavior.
File/open doesn't show you the server headers - you can see the headers
using LiveHttpHeaders addon
(https://addons.mozilla.org/en-US/firefox/addon/3829) or a command line
utility like curl.

For instance, when I try to download the png attachment from
https://bugs.kde.org/show_bug.cgi?id=177403, I get this header from the
content-disposition: attachment; filename="amarok_podcast_leadingblank.png"
This header tells the browser that file must be saved, not displayed.

The reason why this works the way it does is that when you click the
URL, the browser doesn't yet know what the target file type is. If the
file was called "8y2kjndjpwuer", there's no educated guess you could
make - all you have to go by are the server headers. If it's called
"foobar.png" it could make a GUESS, but that would be the wrong way of
doing things (that's what IE does, and I'm sure at least some of its
vulnerabilities were caused by this behavior in the past).


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]