W3C home > Mailing lists > Public > public-webapps@w3.org > April to June 2012

Re: File constructor

From: Bronislav Klučka <Bronislav.Klucka@bauglir.com>
Date: Fri, 11 May 2012 20:20:21 +0200
Message-ID: <4FAD5865.8040207@bauglir.com>
To: public-webapps@w3.org


On 11.5.2012 18:59, Alfonso Martínez de Lizarrondo wrote:
> Almost a year ago there was a thread about this issue (ability to set 
> the filename for a Blob) :
> http://lists.w3.org/Archives/Public/public-webapps/2011AprJun/1342.html
>
>
> 2012/5/11 Bronislav Klučka <Bronislav.Klucka@bauglir.com 
> <mailto:Bronislav.Klucka@bauglir.com>>
>
>     Hi,
>     currently File object cannot be constructed, only Blob can.
>     I'm currently implementing XHR blob upload, that blob can either
>     be File (selected by user) or programatically created Blob.
>     On server side :
>     1/ In case of File, I get file name as part of the file metadata
>     (name, size, type, etc)
>     2/ In case of Blob, I cannot specify name and I have to send it as
>     additional parameter and ignore name metadata
>
>     sending multiple files/blobs at once can be a mess
>
>     is there a reason, while File cannot be created? It is Blob with
>     has name and lastModifyDate .
>     http://dev.w3.org/2006/webapi/FileAPI/#file
>
>     Could there be File constructor, that would work as Blob
>     constructor with 3rd parameter specifying the name of the file and
>     lastModifiedDate set to creation date
>
>     Brona Klucka
>
>
>
I see... there seems to be some consensus, but it probably died on 
little actual interest.

Going through the ideas there, we could amend Jonas'es idea ad consider 
something like

var file = blob.getFile(DOMString filename, optional DomString contentType);

to actually get a File object (since we are moving away from BlobBuilder)


Brona Klucka
Received on Friday, 11 May 2012 18:21:08 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 18:49:52 GMT