[whatwg] Structured clones of Files
glenn at zewt.org
Wed Jan 12 16:57:12 PST 2011
Does the "same underlying data" of a structured clone of a File refer
to a reference to the file (eg. the path and filename, which is the
real underlying data of a File object), or the contents of the file?
As it's used by web worker messaging, it's obviously the pathname.
However, HTML Storage (in theory, anyway) and IndexedDB also use
structured clones, and I'm guessing you're not meant to be able to
store a reference to a File (or FileList) persistently and reopen it
later, which suggests that the actual contents of the file should be
Personally, I think it's both acceptable from a security perspective
and incredibly useful to allow the user to grant access to a file
(or--more importantly--a directory, eventually) just once, and then
access it from then on without the user having to manually grant
access each and every time he uses the application, perhaps requiring
one-time user permission at some point to do so. Storing a reference
in an IndexedDB would allow that. But from what I recall, that's not
currently meant to be allowed.
More information about the whatwg