Based on stimms answer here: Azure Storage API ContentDisposition
and the information found here: Friendly filename when public download Azure blob
I have been able to set the content disposition when uploading new files. But I also would like to be to able to set the content disposition of existing files.
blob.Properties.ContentDisposition = string.Format("attachment;filename=\"{0}\"", friendlyName);
works fine when set before uploading a file, but has no effect if I try it on an existing blob.
Is is just plain impossible to change the content disposition of an existing blob or am I doing something wrong?
Yes. You just have to call
SetProperties()
method on the blob after you setContentDisposition
. So your code should be: