On 08/15/2013 11:29 AM, Roger Dentz wrote:
However it needs to be sent chunked - http://en.wikipedia.org/wiki/Chunked_transfer_encoding The header needs to include "transfer-encoding: chunked" and each block needs to be preceded by a length field. This is a requirement of the server, whether we have all the info available on disk or not.
Chunked encoding doesn't seem to require any discussion between the server and your client, so you should be able to just pre-can all of the chunks.
Blobs know their length (.size) and can be sliced (https://developer.mozilla.org/en-US/docs/Web/API/Blob#slice%28%29). If the server is fine with a single chunk, it seems like you could add that boilerplate. If the server wants to hear about things in smaller chunks, you can slice up the Blob to fake smaller chunks and provide the boilerplate for those chunks too. Those slices will still only be streamed from disk as they are needed.
Unless XHR isn't letting you set the transfer-encoding header? Andrew _______________________________________________ dev-webapps mailing list [email protected] https://lists.mozilla.org/listinfo/dev-webapps
