If you think a bug might affect users in the 57 release, please set the correct tracking and status flags for Release Management.

Save Image As command on an image with a "+" character in its URI creates wrong file name

VERIFIED DUPLICATE of bug 221028

Status

()

Toolkit
Downloads API
VERIFIED DUPLICATE of bug 221028
9 years ago
9 years ago

People

(Reporter: u220127, Unassigned)

Tracking

Firefox Tracking Flags

(Not tracked)

Details

(URL)

(Reporter)

Description

9 years ago
User-Agent:       Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; ru; rv:1.9) Gecko/2008061004 Firefox/3.0
Build Identifier: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; ru; rv:1.9) Gecko/2008061004 Firefox/3.0

If "Save Image As" command from contextual menu is used to save an image with a whitespace or a "+" character in its URL, then the filename in the "Save Image" dialog box will contain only the characters before first whitespace or "+" character.
For Example, if the file name from the example URL is "Funny+Cats+Kissing+(1).jpg", then "Save Image" dialog will contain Funny.jpg as default file name.

Reproducible: Always

Steps to Reproduce:
1. Load image from example URL in a new tab or window
2. Right-click on it to access context menu
3. Use "Save Image As" command from the context menu
Actual Results:  
Default file name in "Save Image" dialog box is "Funny.jpg"

Expected Results:  
Default file name in "Save Image" dialog box should be "Funny+Cats+Kissing+(1).jpg" or "Funny Cats Kissing (1).jpg"

Updated

9 years ago
Whiteboard: DUPEME

Comment 1

9 years ago
+ is not a valid character in a URI (http://en.wikipedia.org/wiki/Percent-encoding)

What happens if you use a valid URI encoding the + signs properly?

Just because it's not valid doesn't mean we can't fix this gracefully.  Lot's of HTML isn't valid but we still render it.  This bug is a dupe, but I don't have the original handy just yet.
(Reporter)

Comment 3

9 years ago
The situation with these pluses is like this: 
1. I upload images with whitespaces in file names to blogger.com. example post here:
http://nekoshiroi.blogspot.com/2008/06/test.html

2. Then I click the image in the post and it is loaded in a separate tab:

firefox shows the following URL for it:
http://bp1.blogger.com/_auZZXSNLU4Y/SF_NxiYWjBI/AAAAAAAAAoo/8k5R26xGY-Y/s1600-h/Funny+Cats+Kissing+(1).jpg
and offers wrong file name for saving: Funny.jpg

safari on the other hand shows URL as:
http://bp1.blogger.com/_auZZXSNLU4Y/SF_NxiYWjBI/AAAAAAAAAoo/8k5R26xGY-Y/s1600-h/Funny+Cats+Kissing+%281%29.jpg
and offers correct file name: Funny Cats Kissing (1).jpg

So, I'm not sure there's something to do with percent-encoding.
The image is served with the following header:

Content-Disposition: attachment;filename=Funny Cats Kissing (1).jpg

Therefore, this is a duplicate of bug 221028.
Status: UNCONFIRMED → RESOLVED
Last Resolved: 9 years ago
Resolution: --- → DUPLICATE
Whiteboard: DUPEME
Duplicate of bug: 221028
Verified duplicate
Status: RESOLVED → VERIFIED
(Assignee)

Updated

9 years ago
Product: Firefox → Toolkit
You need to log in before you can comment on or make changes to this bug.