question

AlexanderAngelo-7181 avatar image
0 Votes"
AlexanderAngelo-7181 asked AlexanderAngelo-7181 edited

Azure blob storage cancel upload

Hi,

I am using Aurelia client and uploading files to Azure Blob Storage.

        azblob.uploadBrowserDataToBlockBlob(azblob.Aborter.none,
             file.fileData,
             blockBlobURL, {
             blockSize: blockSize,
             progress: function (ev) {
                 file.uploadPercent = Math.round((ev.loadedBytes * 100) / file.fileData.size);
                 file.uploadMessage = file.uploadPercent + "%";
                 file.uploadPercentStyle = `width: ${file.uploadPercent}%`;
             }
         }

Now, I want to be able to abort uploading when the user presses a cancel button. Is there a way I can cancel/abort the upload?

thanks
Angelo

azure-storage-accounts
· 2
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

@AlexanderAngelo-7181 Firstly, apologies for the delay in responding here and any inconvenience this issue may have caused.

Can you please elaborate bit more on your issue?
Are using Blob and developing an app or using REST API using Aurelia

0 Votes 0 ·

It's an app using Aurelia. So when users choose files, I am using uploadBrowserDataToBlockBlob to upload the file to Azure Blob Storage - in Aurelia itself (basically using ES6), not invoking any external api to do this. It all works fine but now I am trying to implement a Cancel functionality where for example, if the file takes too long to upload or if they accidentally choose the wrong file, users can click a button to cancel which in turn will cancel the upload - which I think would be best to be placed within the Progress function, but not sure how I can do this.

Thanks for your help

Angelo

1 Vote 1 ·

0 Answers