Firefox's data: URIs handler should support MIME parameters

RESOLVED WONTFIX

Status

()

Firefox
File Handling
RESOLVED WONTFIX
8 years ago
3 months ago

People

(Reporter: Jakub Turski, Unassigned)

Tracking

(Depends on: 1 bug)

Firefox Tracking Flags

(Not tracked)

Details

(Reporter)

Description

8 years ago
User-Agent:       Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; en-US; rv:1.9.1.5) Gecko/20091102 Firefox/3.5.5
Build Identifier: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; en-US; rv:1.9.1.5) Gecko/20091102 Firefox/3.5.5

http://tools.ietf.org/html/rfc2397 describes data: scheme:

---8<----------------
       dataurl    := "data:" [ mediatype ] [ ";base64" ] "," data
       mediatype  := [ type "/" subtype ] *( ";" parameter )
       data       := *urlchar
       parameter  := attribute "=" value

   where "urlchar" is imported from [RFC2396], and "type", "subtype",
   "attribute" and "value" are the corresponding tokens from [RFC2045],
   represented using URL escaped encoding of [RFC2396] as necessary.
---8<----------------

RFC2045 in turn, describes MIME parameters in more details. It would be useful to use 'content-disposition' and 'filename' parameters to influence FF's handling of such data: URI. 

Example:
Entering this URL in location bar:
data:text/html;base64,VGhpcyBpcyBhIHRlc3QK
should result in displaying a page with 'This is a test'.

Entering:
data:text/html;content-disposition=attachment;base64,VGhpcyBpcyBhIHRlc3QK
should result in FF downloading a file containing the above content

and entering:
data:text/html;filename=yay.txt;content-disposition=attachment;base64,VGhpcyBpcyBhIHRlc3QK
should result in FF downloading a file called 'yay.txt', containing the above content.

Is there any reason not to support at least those two parameters? Libraries like jsPDF would be much more useful with that.

Reproducible: Always
(Reporter)

Comment 1

8 years ago
Can we please get some assessment and comment about this bug? I'd like to know what are the chances that this is going to be implemented soon-ish.
(Reporter)

Comment 2

8 years ago
For anyone who arrives here looking for a solution for the problem, http://www.downloadify.info/ is some sort of solution for that.
I suspect this will be implemented when someone picks it up.  See also bug 548516.  But exposing the disposition to internal consumers will also need API changes (which I think we've been thinking about anyway; there are existing bugs on it).
Status: UNCONFIRMED → NEW
Component: General → File Handling
Depends on: 548516
Ever confirmed: true
Product: Firefox → Core
QA Contact: general → file-handling
This has also been discussed on the w3c mailing list: http://lists.w3.org/Archives/Public/uri/2010Feb/0058.html

FWIW, this is not a Mac OS-only issue.

Comment 5

6 years ago
Also, this is not a bug.

If we want to extend the data URI syntax, the right way is to write an Internet Draft that updates RFC 2397 and discuss that in the IETF.

Updated

6 years ago
OS: Mac OS X → All
Hardware: x86 → All

Updated

a year ago
Component: File Handling → File Handling
Product: Core → Firefox

Comment 6

3 months ago
I don't think we should extend data: URLs.
Status: NEW → RESOLVED
Last Resolved: 3 months ago
Resolution: --- → WONTFIX
You need to log in before you can comment on or make changes to this bug.