我有一种将文件添加到 Azure Blob 存储的方法,问题是我试图指定一个条件,在该条件下它不会覆盖 blob,而只是添加到其中。我正在尝试使用参数访问条件,但是 VS 说此方法不能采用两个参数 - async void archiveNewImportedImages(List imageFiles) {
// Saving the images
// Retrieve reference to a blob named "myblob".
// Create or overwrite the "myblob" blob with contents from a local file.
using (var fileStream = System.IO.File.OpenRead(@"C:\Users\rahulchawla\Desktop\FilezilleIMGS\FilezilleIMGS\MTO_Image\CR01-1-20170623-1327.jpg"))
{
await blockBlob.UploadFromStreamAsync(fileStream, accessCondition: AccessCondition.GenerateIfNoneMatchCondition("*"));
}
// save url of the image into a variable and later to the database
/// fileURL = blockBlob.Uri.ToString();
}
Run Code Online (Sandbox Code Playgroud)
有什么建议么?
最终目标:不要覆盖容器 - 继续添加不同的文件,例如。img1.jpg、img2.jpg 转为 blob
其他详细信息:想要将图像附加到容器中(换句话说,继续将图像添加到容器中)。如果文件存在,则不想覆盖现有文件)