1
votes

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.

1

1 Answers

3
votes

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 (e.g. image/png for png files) and this problem should go away.