Skip to content

How to set Blob Content type on the new SDK? #9823

Closed

Description

Hello folks! on the previous versions of te Blob client SDK, it was easy to set the Content-Type of a blob using the blob reference.

Now I see that the new (v12) Azure.Storage.Blobs BlobClient can call GetPropertiesAsync() to get a BlobProperties object but I can't find how to set it.

So, how to properly set the file content type when uploading the blob?

I've found out await blob.SetHttpHeadersAsync(new BlobHttpHeaders { ContentType = GetContentType(fileType) }); but that requires another call to the the storage... Isn't there a better way for doing that while uploading the file?

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    ClientThis issue points to a problem in the data-plane of the library.StorageStorage Service (Queues, Blobs, Files)questionThe issue doesn't require a change to the product in order to be resolved. Most issues start as that

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions