Re: File constructor

On Fri, May 11, 2012 at 9:06 AM, Bronislav Klučka <
Bronislav.Klucka@bauglir.com> wrote:

> 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<http://dev.w3.org/2006/webapi/FileAPI/#file>


The File/Blob distinction is a bit weak.  In some people's views, I
believe, File is for files which are actually backed by files on the user's
filesystem, but there's no actual reason to need that; it's perfectly fine
to have Blobs which are transparently backed by different mechanisms.  (I
don't think the separation has won us much; it would probably have been
fine for them to be a single class, with the few File-like attributes
nullable.)

I'm inclined to suggest that we shouldn't pretend that they're different,
and give File a ctor like Blob's.  (In principle we could have only a File
ctor, since a File with an empty filename and null lastModifiedDate works
anywhere a Blob does...)


On Fri, May 11, 2012 at 1:20 PM, Bronislav Klučka <
Bronislav.Klucka@bauglir.com> wrote:

>  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)
>

The modern equivalent of his BlobBuilder-based suggestion is to add a File
ctor, not to add a method to Blob.

-- 
Glenn Maynard

Received on Friday, 11 May 2012 23:14:51 UTC