Re: [FileAPI] Questions on using Blobs for img src and a href

On Thu, Oct 3, 2013 at 5:35 PM, Brian Matthews (brmatthe) <
brmatthe@cisco.com> wrote:

>  I've been doing some prototyping around displaying images with <img
> src="blob:..."> and providing links to content using <a href="blob:...">.
> I've got it working, and it's all very cool, but there are a couple of
> things that seem like they could work better. They might be things that are
> too user agent specific for the spec (http://www.w3.org/TR/FileAPI/) to
> comment on, but I thought I'd ask here and see if there's something I'm
> missing, and make a suggestion.
>

(FYI, the link you want is http://dev.w3.org/2006/webapi/FileAPI/.  Click
the "Editor's Draft" link at the top of the spec.  This "TR" link happens
to be recent, but they're often very out of date.)

 Note that from the spec one would think I could do a new File(myBlob,
> myFilename), but both Firefox and Chrome throw exceptions when I do that
> (is that expected?), and if I use a "real" File (from a FileList), the name
> doesn't flow through to the blob URL and isn't used when saving.
>

The File ctor is probably not implemented in browsers yet.  They definitely
should use the File's filename as the save-as hint, which may also not yet
be implemented.  You can file bugs on those browsers if you think it'll
help.

-- 
Glenn Maynard

Received on Friday, 4 October 2013 14:44:04 UTC