从HTML链接中的Azure存储下载 [英] Download from Azure storage in html link

查看:71
本文介绍了从HTML链接中的Azure存储下载的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

因此,我有一个文件上传到我的azure存储器,并有一个简单的定位标记,用户可以在其中简单地下载该文件.这是行不通的,也不知道为什么.

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.

我的代码:

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

单击下载链接时,出现错误,提示无效的HTTP标头.这是一个简单的PowerPoint文件.如果我转到Azure中的文件属性,则可以单击下载",它会很好.

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?

推荐答案

您的URL指向Azure文件存储,这与原始Blob不太相同.也就是说,即使文件存储由blob存储支持,也不能在未经适当身份验证(例如,安装smb卷,使用API​​,共享访问签名等)的情况下访问Azure文件存储中的单个文件.

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.

如果您确实将对象存储在Blob(与文件存储)中,则网址应类似于:

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

请注意,URL包含blobfile.

Notice the URL contains blob vs file.

这篇关于从HTML链接中的Azure存储下载的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆