I am currently studying the possibility of reading partial binary XHR responses. Our current approach is based on the responseText and base64 property. Clearly, this is far from optimal.
How can we read partial Blob / ArrayBuffer answers using XHR? When I try in Chrome, the entire ArrayBuffer / Blob array becomes available when readyState = 4, but not earlier than that.
To summarize, it seems to me that:
- Reading the XTR property responseText: responses can be read up to readyState = 4, and we can pass the binary64 encoded binary data back to the client
- Reading the XHR response property with responseType = 'arraybuffer': there is no partial response, but the entire buffer becomes available when readyState = 4
Am I missing something? What approach can be taken to read partial binary answers?
source share