gpt4 book ai didi

asp.net-mvc - 如何获取Azure Files文件的公共(public)URL?

转载 作者:行者123 更新时间:2023-12-05 00:20:30 24 4
gpt4 key购买 nike

我正在使用 Azure 文件来存储我的 Web 应用程序的文件,我之前提到过 here .

我目前正在处理目录中的文件/子目录,并输出导航表,以便用户可以导航到子目录,并最终获取所述文件。我使用 this Azure Documentation article 的“以编程方式访问文件共享”部分中描述的方法来执行此操作。 .

My question is very simple, how can I, from my Web App, which is running in Azure app service, provide a public URL were the user can download/view the file?

请注意,我希望文件自动下载,因为大多数文件都是.PDF,因此可以在浏览器中预览.

最佳答案

My question is very simple, how can I, from my Web App, which is running in Azure app service, provide a public URL were the user can download/view the file?

一种可能的解决方案是在至少具有读取权限的文件上创建共享访问签名(SAS)并使用该SAS URL。根据文件的内容类型,文件的内容将内联显示在浏览器中,或者提示用户下载文件。如果您想强制下载,您可以随时覆盖 SAS 中的 Content-Disposition 响应 header 。

关于asp.net-mvc - 如何获取Azure Files文件的公共(public)URL?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34427041/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com