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

ankit kumar 101 Reputation points
2020-10-11T22:07:12.237+00:00

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 Accounts
Azure Storage Accounts
Globally unique resources that provide access to data management services and serve as the parent namespace for the services.
2,718 questions
Azure Blob Storage
Azure Blob Storage
An Azure service that stores unstructured data in the cloud as blobs.
2,441 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Sumarigo-MSFT 43,806 Reputation points Microsoft Employee
    2020-10-14T05:47:16.507+00:00

    @ankit kumar 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://learn.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://learn.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.