Skip to content

[BUG]Setting content type while uploading streams to azure blob storage is not working (Using 12.27.1 version) #41744

Open
@vasavi-gopisetty

Description

@vasavi-gopisetty

Here is my sample code. Content type is not setting however I try.
BlockBlobClient blockBlobClient = blobContainerClient.getBlobClient("image.png").getBlockBlobClient();
blockBlobClient.setHttpHeaders(new BlobHttpHeaders().setContentType("image/png"));

BlobOutputStream blobOutputStream=null;
try {

blobOutputStream = blockBlobClient.getBlobOutputStream();

ByteArrayInputStream bis = new ByteArrayInputStream(inputStream.readAllBytes());
int next = bis.read();
while (next != -1) {
    blobOutputStream.write(next);
    next = bis.read();
}  

}finally {
blobOutputStream.close();
}

Metadata

Metadata

Assignees

Labels

ClientThis issue points to a problem in the data-plane of the library.StorageStorage Service (Queues, Blobs, Files)customer-reportedIssues that are reported by GitHub users external to the Azure organization.needs-team-attentionWorkflow: This issue needs attention from Azure service team or SDK teamquestionThe 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