Skip to content

Instantly share code, notes, and snippets.

@codingoutloud
Created February 13, 2013 19:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save codingoutloud/4947341 to your computer and use it in GitHub Desktop.
Save codingoutloud/4947341 to your computer and use it in GitHub Desktop.
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