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

Re: XMLHttpRequest.responseBlob

From: Darin Fisher <darin@chromium.org>
Date: Mon, 26 Apr 2010 15:39:50 -0700
Message-ID: <v2mbd8f24d21004261539m5e16067avb988029419d2dbc1@mail.gmail.com>
To: Jonas Sicking <jonas@sicking.cc>
Cc: Web Applications Working Group WG <public-webapps@w3.org>
On Mon, Apr 26, 2010 at 3:29 PM, Jonas Sicking <jonas@sicking.cc> wrote:

> On Mon, Apr 26, 2010 at 3:21 PM, Darin Fisher <darin@chromium.org> wrote:
> > There is some interest from application developers at Google in being
> able
> > to get a Blob corresponding to the response body of a XMLHttpRequest.
> > The use case is to improve the efficiency of getting a Blob from a binary
> > resource downloaded via XHR.
> > The alternative is to play games with character encodings so that
> > responseText can be used to fetch an image as a string, and then use
> > BlobBuilder to reconstruct the image file, again being careful with the
> > implicit character conversions.  All of this is very inefficient.
> > Is there any appetite for adding a responseBlob getter on XHR?
>
> There has been talk about exposing a responseBody property which would
> contain the binary response. However ECMAScript is still lacking a
> binary type.
>
> Blob does fit the bill in that it represents binary data, however it's
> asynchronous nature is probably not ideal here, right?
>
> / Jonas
>


I think there are applications that do not require direct access to the
response data.

For example,

1- Download a binary resource (e.g., an image) via XHR.
2- Load the resource using Blob.URN (assuming URN moves from File to Blob).

It may be the case that providing direct access to the response data may be
more
expensive than just providing the application with a handle to the data.
 Consider
the case of large files.

-Darin
Received on Monday, 26 April 2010 22:40:21 GMT

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