简体   繁体   中英

Accessing Images From Azure Blob Storage

I am working on a nodejs project and i am using Azure blob storage to store my Images. I created containers inside the blob and allowed anonymous blob access. Now i have a problem in that when i upload the images using their npm package and try to access the Images using its public url, the image tend to download instead of me viewing it from the browser. But if i upload the image manually to the blob from the Azure portal i am able to view the image with its url from the browser without having to download it. Luckly i am able to access the images from an element. But if i right click on the image and try open in a new tab the image downloads instead of being viewed from the browser. Note that this does not happen to images i upload manually. Please help me find out why this is happening.

This issue is happening because of the content-type property of the blob. More than likely it is set as “application/octet-stream”. Please change the content type to a proper value (eg image/png for png files) and this problem should go away.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM