[whatwg] Structured clones of Files

Ian Hickson ian at hixie.ch
Mon Jan 31 15:13:11 PST 2011


On Wed, 12 Jan 2011, Glenn Maynard wrote:
>
> 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 stored.
> 
> 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.

This is intended to be up to the user. We should clarify this in the File 
API specs, though.

-- 
Ian Hickson               U+1047E                )\._.,--....,'``.    fL
http://ln.hixie.ch/       U+263A                /,   _.. \   _\  ;`._ ,.
Things that are impossible just take longer.   `._.-(,_..'--(,_..'`-.;.'



More information about the whatwg mailing list