I'm trying to upload images to azure storage like so:
var xhr = new XMLHttpRequest();
xhr.open("GET", blobUrl);
xhr.responseType = "text";//force the HTTP response, response-type header to be blob
xhr.onload = function () {
blobService.createBlockBlobFromText('taskcontainer', 'myblob', xhr.responseText, {contentSettings: {contentType: "image/bmp"}}, (error, result, response)=>{
})
}
xhr.send();
If I upload something simple like a text file with 'abc' it uploads fine, however if I try to upload something like an image it seems to get corrupted, the diff shows the file after it was uploaded to azure (left) and before it was uploaded: https://user-images.githubusercontent.com/2121021/35678518-cb006af4-07a7-11e8-963d-2bb8b45aba26.png
I'm not sure what's going on exactly and have been trying to solve this for a while now...