[Bug 207670] [NEW] "Save Image As" Suggests Wrong Filename/MIME Type with Redirect

Ben launchpad.net at inelegant.org
Thu Mar 27 11:15:57 UTC 2008


Public bug reported:

Binary package hint: firefox-3.0

(I wasn't sure which of the myriad of Firefox packages to file this
against. I'm running Firefox 3, beta 4 in Hardy).

Description
=======
If I follow a link which redirects to an image file (i.e. a document with an image/* MIME type) then right click on the image and choose "Save Image As" the resulting dialog box suggests a filename for said image based on the referring URLs path and MIME type.

How to Reproduce
=============

For example, and apologies in advance, visit http://fotos.nazjam.com/wp-
content/uploads/2008/03/imagem220.jpg and right click "Save Image As".
You should be prompted to save it as "imagem220.jpg", which makes
perfect sense. However, visit
http://reddit.com/goto?rss=true&id=t3_6dfq9 , which redirects to the
former URL, and repeat this process. This time the suggested filename is
"goto.html". This is problematic for two reasons: (a) the filename
doesn't make sense, (b) the MIME type is butchered. The result is that
the user has a file on disk named "goto.html" which is associated with
Firefox, but when opened displays the binary data of the JPEG.

 ben at dev:~$ wget "http://reddit.com/goto?rss=true&id=t3_6dfq9"
 --10:41:15--  http://reddit.com/goto?rss=true&id=t3_6dfq9
            => `goto?rss=true&id=t3_6dfq9'
 Resolving reddit.com... 208.96.53.70
 Connecting to reddit.com|208.96.53.70|:80... connected.
 HTTP request sent, awaiting response... 302 Found
 Location: http://fotos.nazjam.com/wp-content/uploads/2008/03/imagem220.jpg [following]
 --10:41:16--  http://fotos.nazjam.com/wp-content/uploads/2008/03/imagem220.jpg
            => `imagem220.jpg'
 Resolving fotos.nazjam.com... 206.51.235.10
 Connecting to fotos.nazjam.com|206.51.235.10|:80... connected.
 HTTP request sent, awaiting response... 200 OK
 Length: 49,230 (48K) [image/jpeg]

100%[=================================================================================================================>]
49,230        47.79K/s

 10:41:18 (47.67 KB/s) - `imagem220.jpg' saved [49230/49230]

Comments
=======
* Possibly, because the redirect is temporary, Firefox is using the original URL as the basis for the filename heuristic...
* This behavior is repeatable with other images from Reddit. I haven't tested any other sites.
* It occurs even when Firefox is invoked with the _-safe-mode_ switch. I don't believe this is extension related.
* Epiphany handles this case in the manner you would expect: the suggested filename is "imagem220.jpg".

Workaround
=========
* Use File > Save Page As
* Load the image URL directly

System
=====
 ben at dev:~$ lsb_release -rd
 Description:	Ubuntu hardy (development branch)
 Release:	8.04

 ben at dev:~$ apt-cache policy firefox-3.0
 firefox-3.0:
   Installed: 3.0~b4+nobinonly-0ubuntu1
   Candidate: 3.0~b4+nobinonly-0ubuntu1
   Version table:
  *** 3.0~b4+nobinonly-0ubuntu1 0
         500 http://archive.ubuntu.com hardy/main Packages
         100 /var/lib/dpkg/status

 ben at dev:~$ uname -a
 Linux dev 2.6.24-12-386 #1 Wed Mar 12 22:30:29 UTC 2008 i686 GNU/Linux

** Affects: firefox-3.0 (Ubuntu)
     Importance: Undecided
         Status: New


** Tags: firefox images web

-- 
"Save Image As" Suggests Wrong Filename/MIME Type with Redirect
https://bugs.launchpad.net/bugs/207670
You received this bug notification because you are a member of Mozilla
Bugs, which is subscribed to firefox-3.0 in ubuntu.




More information about the Ubuntu-mozillateam-bugs mailing list