2

I've seen similar questions but so far am unable to solve this problem:

I am trying to download a file (mp4) located in Azure Blob storage when an anchor is clicked. This currently worked in Chrome, Firefox, Safari etc but from what I'm aware IE doesn't support the download attribute.

I have access to the storage account so tried changing the Content-Type to application/force-download and the Content-Disposition to attachment;filename=someName. This resolved the problem for Firefox cross domain limits but still no joy in IE. I have tried application/octet-stream but this did not work either.

Currently in IE11 it tries to open Windows Media Player (not sure why), but in IE10 and lower nothing happens, the browser just hangs whilst trying to navigate to the blob storage URL.

So next was to try some client side. Using Jquery I attempted the following:

$('.fallback[data-auto-download]').click(function () {
    var $this = $(this);
    window.location = $this.attr('href'); //download file 
    setTimeout(function () {
        window.location.href = "/Content/Confirmation";
    }, 3000); //redirect to new page after timeout
});

And this is how it looks in the markup:

<a class="fallback" data-auto-download href="http://someBlobURL">Download video</a>

As mentioned above this is not working for IE. Are there any current methods to get this to work? Research states to change the Content Type but that doesn't seem to get it working.

Please note: We cannot use right click to save target as because this project requires a new page to be loaded when the file download has been initiated.

0x860111
  • 386
  • 1
  • 3
  • 15
user1043177
  • 83
  • 1
  • 7
  • how you tried checking this thread? [Download attribute on A tag not working in IE](https://stackoverflow.com/questions/18394871/download-attribute-on-a-tag-not-working-in-ie) – Peter John Paul Tactacan Apr 02 '18 at 10:22

0 Answers0