I have a api call that sends me the a stream of a file. I get the stream and put it out as an uInt8Array.
Im using this html5 example:
http://www.html5rocks.com/en/tutorials/file/xhr2/
I know what the file name and type is, how do I put this array data into a "file" and give that to the user to download?
xhr = new XMLHttpRequest()
xhr.open "GET", "#{window.API_URL}/transfer/123/2134/#{program_id}", true
xhr.responseType = "arraybuffer"
xhr.onloadstart = (e) ->
# downloading file notify on footer
xhr.onprogress = (e) ->
# show progress and size of file.
console.log "#{Math.round(e.loaded/e.total)*100}% completed"
xhr.onload = (e) ->
uInt8Array = new Uint8Array(@response)
xhr.send()