Mark
Mark

Reputation: 1872

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?

Upvotes: 2

Views: 2953

Answers (1)

David Makogon
David Makogon

Reputation: 71029

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.

Upvotes: 3

Related Questions