I've been banging my head for a few weeks on a problem.
I provide a download url to the client in order to download content from the storage. Here's how I do that:
var sasConstraints = new SharedAccessBlobPolicy();
sasConstraints.SharedAccessStartTime = DateTime.UtcNow.AddMinutes(-5);
sasConstraints.SharedAccessExpiryTime = DateTime.UtcNow.AddMinutes(10);
sasConstraints.Permissions = SharedAccessBlobPermissions.Read;
var sasBlobToken = blob.GetSharedAccessSignature(sasConstraints);
This way I generate a link to the Azure storage blob.
Now I send this link to the client and open it as :
let a = document.createElement('a');
a.download = data.fileName;
a.href = data.url
a.click()
document.removeChild(a)
But it still doesn't download the file with the correct file name ( it downloads it as the GUID of the blob). This happens because the azure storage overrides with headers the name i specified in the download
attribute. How do I get the correct file name to be delivered? Should I try to disable the headers of the Azure storage? Should I change the code on the client?