Javascript download a URL - Azure Blob Storage

Viewed 6564

I am using Azure Blob Storage, and I want users to be able to download files. When a user clicks a file they want to download, I use AJAX to generate a shared access signature and return the URL to download from. Is there any way for me to then, using Javascript, download the file? Or is there some other method I can use... I also would like it to not run server side, as there is no reason to incur unnecessary cost when I should be able to download directly from the URL...

Basically, how Dropbox does it... Is it submitting some form somehow? It doesn't even have to be like that.

4 Answers

Once you have the url to download the file you can use the package fs-browsers.
It has nice and easy download method for client-side.
It goes like this:

import { downloadFile } from 'fs-browsers';
downloadFile(url-to-the-file);

Related