douxiangshi6568 2017-04-20 15:54
浏览 80

如何在不泄露URL的情况下安全地在浏览器中呈现Azure存储的图像?

Say I have my file stored at (real credentials removed):

https://mystorageaccount.blob.core.windows.net/mycontainer/thumbnails/1234567890/thumbnail.jpg

A) This file is currently downloadable if I simply browse to it - I really don't think that should be possible.

B) I want to render this in my app without allowing the user to see the URL.

I am using PHP on the backend. Is there some method wherein I download the image to the server and render it from there? Is that efficient?

Any thoughts appreciated.

  • 写回答

1条回答 默认 最新

  • dsgrs26202 2017-04-20 18:02
    关注

    These are the options you have:

    1. Make the blobs/container public and embed with the public URL
    2. Generate a temporary SAS token for the blob and embed with URL + SAS token
    3. Download the blob from your backend with a storage key and stream it through it to the client

    With option 1 the file must be publicly accessible, which I guess you don't want.

    That leaves options 2 and 3.

    If you are okay with revealing the URL, but only giving the user temporary access to the file, option 2 can be a good one.

    Otherwise you only have option 3.

    The good side of options 1 and 2 is that the blob download happens from Storage to user directly, and your app doesn't have to spend time/bandwidth on streaming files.

    评论

报告相同问题?

悬赏问题

  • ¥15 python的qt5界面
  • ¥15 无线电能传输系统MATLAB仿真问题
  • ¥50 如何用脚本实现输入法的热键设置
  • ¥20 我想使用一些网络协议或者部分协议也行,主要想实现类似于traceroute的一定步长内的路由拓扑功能
  • ¥30 深度学习,前后端连接
  • ¥15 孟德尔随机化结果不一致
  • ¥15 apm2.8飞控罗盘bad health,加速度计校准失败
  • ¥15 求解O-S方程的特征值问题给出边界层布拉休斯平行流的中性曲线
  • ¥15 谁有desed数据集呀
  • ¥20 手写数字识别运行c仿真时,程序报错错误代码sim211-100