title: How to cancel an upload started with BlobService.createBlockBlobFromBrowserFile?
body: <p>I'm using Microsoft Azure Storage Client Library's <a href="https://azure.github.io/azure-storage-node/BlobService.html#createBlockBlobFromBrowserFile__anchor" rel="nofollow noreferrer"><code>BlobService.createBlockBlobFromBrowserFile</code></a> to allow users to upload files to an Azure Storage container. I'd like to provide a way for them to cancel an in-progress upload, e.g. in case it's big and taking too long or they chose the wrong file. Is there any way I can do this though? I can't see anything obvious in the API. </p>
  
  <p>My code is based on <a href="https://dmrelease.blob.core.windows.net/azurestoragejssample/samples/sample-blob.html#step5" rel="nofollow noreferrer">these samples</a>, e.g.</p>
  
  <pre><code>var file = document.getElementById('fileinput').files[0];
  
  var customBlockSize = file.size &gt; 1024 * 1024 * 32 ? 1024 * 1024 * 4 : 1024 * 512;
  blobService.singleBlobPutThresholdInBytes = customBlockSize;
  
  var finishedOrError = false;
  var speedSummary = blobService.createBlockBlobFromBrowserFile('mycontainer', file.name, file, {blockSize : customBlockSize}, function(error, result, response) {
      finishedOrError = true;
      if (error) {
          // Upload blob failed
      } else {
          // Upload successfully
      }
  });
  refreshProgress();
  </code></pre>
  
  <p>The <code>SpeedSummary</code> object returned from <code>createBlockBlobFromBrowserFile</code> is I think <a href="https://github.com/Azure/azure-sdk-for-node/blob/c98fd8ff9310f688a7ff6a227015876cd1f722ab/lib/services/legacyStorage/lib/blob/internal/speedsummary.js" rel="nofollow noreferrer">this one</a>, which doesn't have anything like that available.</p>
  
  <p>Also asked on <a href="https://social.msdn.microsoft.com/Forums/azure/en-US/e343fca8-a1f5-445b-b7a3-92ad0b210f64/azure-storage-client-library-for-js-how-to-cancel-an-upload-started-with?forum=windowsazuredata" rel="nofollow noreferrer">MSDN here</a>.</p>