Azure Container Blob Does Not Let Me Upload Files

In this post nosotros will talk about content type belongings of a blob in Azure Blob Storage, what would happen if you ready the content type property incorrectly (or don't set information technology) and how you lot can use Cerebrata to quickly set the content type belongings of blobs in bulk.

About Content Type Property

In Azure Blob Storage, for whatever blob one of an important system belongings is its content type. Content type becomes important because based on the value of this property, a user agent (typically a web browser) decides how to brandish the content.

Setting it to incorrect value or not setting it all can atomic number 82 to unintended beliefs when displaying the content.

Consider this for example. Let's say you lot have uploaded a PNG image and forgot to set up the content type property. In Azure Storage, if y'all do non set the content blazon holding of the blob information technology is set as "application/octet-stream" by default. At present when you try to access that hulk past using its URL in the browser's accost bar, instead of displaying the prototype in the browser information technology gets downloaded. This is because your spider web browser does not know how to deal with an object with "application/octet-stream" content type.

This problem can be easily fixed by simply changing the content blazon property of the hulk to the correct ane (image/png in this case). For one or ii blobs, it is non a big deal but what would you do if you have a large number of blobs (thousands or may be millions). Setting the content type property of each blob individually is merely not possible.

How Cerebrata tin help?

Cerebrata has this feature that enables you to set content type backdrop on multiple blobs conveniently. For case, have a look at the screenshot below.

Here I have a blob container that has some blobs. I made the mistake of not setting the content type property of the blob while uploading them through code (Uploading them through Cerebrata will always fix the proper content type). As a effect of this, all the blobs in my container have "application/octet-stream" every bit content type.

To change the content blazon of all the blobs, I would simply click on "Set Properties" button.

On the popup window that opens, all I have to practice is select "Assign Content Type based on Blob Extension" option under "Content Blazon" and click on "Submit" push button.

Cerebrata will spawn a background job that will change the content type property of all the blobs based on the blob file extension equally shown in the screenshot below.

To modify content blazon property of selected blobs, just select the blobs for which y'all wish to change the content type and follow the aforementioned procedure as above.

To change the content type property of all blobs inside a container, simply right click on the blob container and click on "Set Backdrop (All Blobs)…" context carte item and follow the same procedure as above.

As you can come across that Cerebrata makes it really piece of cake for you to set the content type properties on multiple blobs thus making y'all more productive. BTW, this feature is not available in Microsoft Storage Explorer or any other tool available in the market. You can of course write some lawmaking to accomplish the aforementioned but and so that would have your focus abroad from your cadre application.

Moreover, you tin can use the aforementioned feature to fix other properties of blobs in bulk. Peculiarly important is "Cache Control" property of the blob.

Apart from Azure Storage, Cerebrata Cerebrata enables y'all to manage your Azure Cosmos DB accounts (SQL API, Gremlin API and Table API), Service Bus Namespaces, Cognitive Search Service accounts, Redis Enshroud accounts and much more. It is as well cross platform then that you lot can manage your Azure resources from a platform of your choice – Windows, Mac or Linux.

If you wish to experience Cerebreta, endeavor our xv days free trial.

milesafearighted.blogspot.com

Source: https://cerebrata.com/blog/how-to-set-the-content-type-of-blobs-based-on-its-file-extension-in-bulk

0 Response to "Azure Container Blob Does Not Let Me Upload Files"

Postar um comentário

Iklan Atas Artikel

Iklan Tengah Artikel 1

Iklan Tengah Artikel 2

Iklan Bawah Artikel