Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Snippet of Azure Client SDK 1.7 code that demonstrates setting ContentType and CacheControl headers.
// .NET Storage SDK 1.7
CloudBlob destBlob = TargetContainer.GetBlobReference(destFileName);
destBlob.Properties.ContentType = "image/jpeg";
destBlob.Properties.CacheControl = "x-ms-blob-cache-control: public, max-age=31556926"; // cache for up to one year
try
{
destBlob.UploadFile(sourceFilespec);
}
catch(Exception ex)
{
logger.ErrorFormat("UploadFile exception: {0}", ex.ToString());
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment