I am looking for a way to uploading files to Azure Blob Storage. I found azure-storage npm package. But I'm having a problem with 'createBlockBlobFromStream' method.
I dont know how create stream from Uint8Array.
xhr.onload = function (e) {
if (this.status == 200) {
// Note: .response instead of .responseText
const blob = new Blob([this.response]);
console.log(audios[i].file);
const reader = new FileReader();
reader.onload = function () {
const data = new Uint8Array(reader.result);
Meteor.call('uploadFilesViaSDK', data);
};
reader.readAsArrayBuffer(blob);
}
};
I`m trying to migarate files from S3 to Azure blob. Thats why I dowload files from S3, and than read it as ArrayBuffer and convert it to Uint8Array. And now I am looking way how to upload this data to azure via azure.createBlockBlobFromStream meyhod. Specifically, I need an example of creating a stream from Uint8Array.
I'll be grateful for any answer