Closed Bug 532230 Opened 12 years ago Closed 5 years ago

Firefox's data: URIs handler should support MIME parameters

Categories

(Firefox :: File Handling, defect)

defect
Not set
normal

Tracking

()

RESOLVED WONTFIX

People

(Reporter: yacoob, Unassigned)

References

(Depends on 1 open bug)

Details

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
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.
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.
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.
OS: Mac OS X → All
Hardware: x86 → All
Product: Core → Firefox
I don't think we should extend data: URLs.
Status: NEW → RESOLVED
Closed: 5 years ago
Resolution: --- → WONTFIX
You need to log in before you can comment on or make changes to this bug.