如果存在相同的名称,是否有任何方法可以替换文件?我在Azure存储中看不到任何替换方法.这是我的代码:
var client = new CloudBlobClient( new Uri(" http://sweetapp.blob.core.windows.net/"),credentials); var container = client.GetContainerReference("cakepictures"); await container.CreateIfNotExistsAsync(); var perm = new BlobContainerPermissions(); perm.PublicAccess = BlobContainerPublicAccessType.Blob; await container.SetPermissionsAsync(perm); var blockBlob = container.GetBlockBlobReference(newfilename + i + file.FileType); using (var fileStream = await file.OpenSequentialReadAsync()) { await blockBlob.UploadFromStreamAsync(fileStream); }