Bug 25887 - Should have a way to convert File objects to data: urls
Summary: Should have a way to convert File objects to data: urls
Status: RESOLVED INVALID
Alias: None
Product: WebKit
Classification: Unclassified
Component: DOM (show other bugs)
Version: 528+ (Nightly build)
Hardware: Mac OS X 10.5
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks: 25886
  Show dependency treegraph
 
Reported: 2009-05-20 00:47 PDT by Eric Seidel (no email)
Modified: 2023-08-23 07:43 PDT (History)
7 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Eric Seidel (no email) 2009-05-20 00:47:14 PDT
Should have a way to convert File objects to data: urls

This would allow you to display a preview image for an uploading attachment, or to store an image in the Database and display it later.  Related to bug 25886.

Something like:
file.toDataURL(encoding)  // or URI?

http://en.wikipedia.org/wiki/Data_URI_scheme
Comment 1 Sam Weinig 2009-05-20 07:50:14 PDT
While the FileUpload spec (http://dev.w3.org/2006/webapi/FileUpload/publish/FileUpload.html) does currently have support for this, I don't think we should implement it as it is currently spec and have express that concern the the editor.  My concern is with synchronous access to the disk, so, an async api would be a solution. 
Comment 2 Ojan Vafai 2009-06-11 15:58:32 PDT
Looks like http://dev.w3.org/2006/webapi/FileUpload/publish/FileAPI.xhtml is the new spec for this, which does make disk access async.
Comment 3 Anne van Kesteren 2023-08-23 07:43:14 PDT
This bug has clearly been overtaken by events.