Uploading blockblob and setting contenttype
Uploading blockblob and setting contenttype
Uploading blockblob and setting contenttype
Re: Uploading blockblob and setting contenttype
Actually you don't have to call SetProperties method. In order to set content type while uploading the blob, just set the `ContentType` property before calling the upload method. So your code should be:
```
// Save image
CloudBlockBlob blockBlob = container.GetBlockBlobReference("blah.jpg");
blockBlob.Properties.ContentType = "image/jpg";
blockBlob.UploadFromByteArray(byteArrayThumbnail, 0, byteArrayThumbnail.Length);
```
and that should do the trick.
```
// Save image
CloudBlockBlob blockBlob = container.GetBlockBlobReference("blah.jpg");
blockBlob.Properties.ContentType = "image/jpg";
blockBlob.UploadFromByteArray(byteArrayThumbnail, 0, byteArrayThumbnail.Length);
```
and that should do the trick.