question

ankitkumar-4433 avatar image
0 Votes"
ankitkumar-4433 asked ·

The content type of blob changes on copying from one storage account to other

Hi,

I am getting this strange issue where on copying blobs from one storage account to other, the content type of blob changes. so in Storage A, I have a blob with content type as application/octet-stream which a .txt file, if I copy this file to my storage account B using storage explorer, the content type changes to text/plain; charset=utf-8

Problem now I am having is with application/octet-stream as I designed my logic app with my storage explorer B and now changing the connection string to Storage Explorer A , my logic app is returning application/octet-stream which i believe is giving me error as resource not foundin logic app.

So i would like to know why this behavior. Is there some way we can define the content type of a storage account?



azure-storage-accountsazure-blob-storage
10 |1000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

Sumarigo-MSFT avatar image
0 Votes"
Sumarigo-MSFT answered ·

@ankitkumar-4433 Firstly, apologies for the delay in responding here and any inconvenience this issue may have caused.

Are you using the latest version of Azure Storage Explorer? This issue may occur when you are using the older version of Azure Storage explorer sometimes

Could you set the content type when creating the blob with the one they get from when they received the blob, Can you use Get Blob Metadata - https://docs.microsoft.com/en-us/connectors/azureblob/#get-blob-metadata - separately to know the media type( pass the content type while creating the blob if you want to enforce)

Can you try to copy blobs from one storage account to another storage account using Azcopy and let me know if the content types are changing.

There is also a similar discussion in the Storage Explorer and SO forum, can you please refer to the suggestion which provide some idea on your scenario.

Note: azcopy sync

https://docs.microsoft.com/en-us/azure/storage/common/storage-ref-azcopy-sync

Advanced

If you don't specify a file extension, AzCopy automatically detects the content type of the files when uploading from the local disk, based on the file extension or content (if no extension is specified).

The built-in lookup table is small, but on Unix, it's augmented by the local system's mime.types file(s) if available under one or more of these names:

/etc/mime.types
/etc/apache2/mime.types
/etc/apache/mime.types
On Windows, MIME types are extracted from the registry.

If the issue still persist, I would like to work closer on this issue

Hope this helps! Kindly let us know if the above helps or you need further assistance on this issue.



Please don’t forget to "Accept the answer” and “up-vote” wherever the information provided helps you, this can be beneficial to other community members.


· 3 ·
10 |1000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

@ankitkumar-4433 Just checking in to see if the above answer helped. If this answers your query, please don’t forget to "Accept the answer" and Up-Vote for the same, which might be beneficial to other community members reading this thread. And, if you have any further query do let us know.

0 Votes 0 ·

@ankitkumar-4433 Just checking in to see if the above answer helped. If this answers your query, please don’t forget to "Accept the answer" and Up-Vote for the same, which might be beneficial to other community members reading this thread. And, if you have any further query do let us know.

0 Votes 0 ·

@Sumarigo-MSFT Recently I tried to copy files from one storage account to another storage account using azcopy. After that we have found all the files in the destination folder is having content-type as text/plain. Could you help us to solve this issue?

0 Votes 0 ·