Calling UploadFromStream overwrites files by default – how can I make sure I only upload a blob if it isn’t already in the container?
CloudBlockBlob blockBlob = container.GetBlockBlobReference(blobName);
blockBlob.UploadFromStream(stream)
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Add an access condition to the code so that it checks against the ETag property of the blob – wildcards are allowed, so we want to only allow the upload if no blobs with this name have any etag (which is a roundabout way of saying, does this blob name exist).
You get a StorageException as detailed below.