In my previous post, I mentioned that I will be addressing few considerations in next blog posts. So Till now, I have successfully uploaded web pages in Azure blobs and my joy knew no bounds when it worked! BTW: I had just tested it in IE. Now, as a good web developer – it was time to check how the site behaved in other browsers.
So I opened http://paras.blob.core.windows.net/demo-site-solidq/default.htm (Let me reiterate, please put in the full path along with the ‘default.htm’ at the end of the URI because Azure blob storage does not support default documents)
in the mozilla firefox. And BOOM !– I got this:
My world crashed right in front of eyes – So now, it was time to put on the detective hat and try and figure out what happened? a few search queries help me figure out that “if I set the content type of the blob content properly – I would not have any issue”. Okay, so what does this mean. Every blob has a content-type property. without exception. And one can edit it. I would be using Azure storage explorer to do so. You could use other tool if you wish that has the ability to change the property of a blob content.
I am not going to show a step by step process to access blob contents through Azure storage explorer – I am directly jumping to the explorer. here is what I see:
I have changed the content type of all html files from “application/octet-stream” to “html”. you could do that by double clicking on any blob content. if you do so – you will see:
Here you can edit the ContentType files and click on “save properties”. Done!
Now, when I open the URI – http://paras.blob.core.windows.net/demo-site-solidq/default.htm in Mozilla firefox. I get the expected result!