Not exactly. This Gears proposal introduces an extra level of indirection with Blobs that this proposal does not. This can be seen as a subset, that Blobs could build on in the future, and in fact is entirely compatible with the Gears proposal.

-Sam

On Jul 17, 2008, at 1:23 PM, Aaron Boodman wrote:


Is the only difference from the Gears proposal the name of the object
("File") and the lack of reading APIs initially?

- a

On Thu, Jul 17, 2008 at 1:14 PM, Sam Weinig <[EMAIL PROTECTED]> wrote:
We would like to propose standardizing a way of using XMLHttpRequest to send files to the server. We propose using a similar (and compatible) API to the
Blob based API proposed by Google Gears
(http://code.google.com/p/gears/wiki/BlobWebAPIPropsal), but instead of sending Blob objects, the File objects would be sent. This will allow the common act of uploading files, now relegated to form submissions with an <input type="file">, to have access to ProgressEvents and the ability to
abort mid way through.
As with the Blob API, this is reuses the File and FileList interfaces
exposed by Mozilla
(see http://developer.mozilla.org/en/docs/nsIDOMFile and 
http://developer.mozilla.org/en/docs/nsIDOMFileList)
in a compatible. We are not proposing a specific way to get the contents of the files, but that would be a natural future extension. Other potential future extensions would be access to the icon associated with the file.

Objects implementing the HTMLInputElement interface must also implement the
FileHTMLInputElement interface.
interface FileHTMLInputElement {
  readonly attribute FileList files;
};

The files attribute must return a FileList containing all the files
currently selected. This list is live, and therefore updates if contents of
the input element change.
interface FileList {
  readonly attribute unsigned long length
  [IndexGetter] File item(in unsigned long index);
};

Each item in the FileList is File, which is a token representation of file on the system. The fileName attribute returns just the name and not the complete path. The fileSize attribute returns the size of the file in
bytes.
interface File {
  readonly attribute DOMString fileName;
  readonly attribute unsigned long long fileSize;
};

Sending a File can be accomplished with an extension to XMLHttpRequest that
overrides the existing send() method.
Objects implementing the XMLHttpRequest interface must also implement
the FileXMLHttpRequest interface.
interface FileXMLHttpRequest {
  void send(File data);
};


-Sam Weinig




Reply via email to