[whatwg] creating a new file via the File API

Glenn Maynard glenn at zewt.org
Sun Dec 18 22:18:31 PST 2011


2011/12/19 David Karger <karger at mit.edu>:
>   What you're doing is certainly connected, but I don't think it solves the
> problem I outlined.  Your approach allows specification of the download
> target as an attribute in html.   That's useful, but what's still missing,
> and I consider important, is a way to connect the html document to the "Save
> As" dialog available on all OSes. <input> tags lead browsers to launch the
> "Open File" dialog, which lets the user naturally navigate their file system
> to select a file to open.   Browsers also launch the analogous "Save As"
> dialog, but _only_ when you execute a download from a server.  I think it's
> important to enter the same "Save As" dialog programmatically, for
> client-side generated content.  I don't think this raises the security
> issues discussed at mozilla, because the user is engaged in the same
> interaction as they are on any other file download.

As Eric already answered, this is what the proposed FileSaver API is for.

(It wouldn't make sense for this to be exposed as a tag, any more than
it would make sense for XHR or History or IndexedDB to be tags.  It's
just an API that you can hook up to whatever UI you want.)

-- 
Glenn Maynard



More information about the whatwg mailing list