Mark Mark - 4 days ago 5
HTML Question

Download from Azure storage in html link

So I have a file uploaded to my azure storage and have a simple anchor tag where a user should be able to simply download the file. This is not working and not understanding why.

My code:

<a href="https://cembsite.file.core.windows.net/cembapphandouts/IsraelHandouts/Solution Interview Worksheet.pptx">Get Worksheet Here!</a>


When you click on the link to download, it takes to an error saying invalid http header. This is a simple powerpoint file. If I go to the file properties within Azure, I can click download and it does fine.

Any thoughts to how I can resolve this?

Answer

Your URL is pointing to Azure File storage, which is not quite the same as raw blobs. That is, you cannot just access individual files within the Azure File store without proper authentication (e.g. mounting the smb volume, using the API, Shared Access Signature, etc), even though File Storage is backed by blob storage.

If you truly stored the object in a blob (vs File Storage), then the url should look something like:

https://cembsite.blob.core.windows.net/containername/filename.pptx

Notice the URL contains blob vs file.

Comments