[whatwg] constructing a FileAPI blob for XHR2

Toni Ruottu toni.ruottu at iki.fi
Sun Jul 25 01:44:41 PDT 2010


  hello

I am hoping that I could, in the future, send arbitrary binary data
with XHR. The XHR level 2 specification tells me that to send binary
data I need to do send(blob). Blob is defined in FileAPI which tells
me how to read data to a blob from the hard disk.

Now, my problem is that I have the data in memory. Either as base64,
list of integers representing bytes, 16-bit strings with irrelevant
high bits, data url, or such. Converting between the different formats
is already possible, so if I could convert any one of those formats
into a blob I would be happy.

My understanding is that with the current specification I need to ask
the user to write the data into a file and read it back to get it into
a blob. Is this correct, or can I find a blob constructor function
defined somewhere?

  best regards, --Toni


More information about the whatwg mailing list