Created
February 13, 2013 19:24
-
-
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.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// .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