![](/img/trans.png)
[英]Upload a file asynchronously to Azure blob storage and then delete the local file
[英]Azure File storage validate file after upload before deleting local copy
我們正在將數據遷移到 Azure 文件存儲,並希望在上傳完成后驗證上傳,然后再從本地服務器刪除文件。
下面的代碼工作正常,但我對文檔中關於之后如何驗證文件的內容有點不清楚。
我打算比較字節數,但看起來使用 transactionalCRC 會起作用,但我似乎無法實現它
byte[] theFile = UploadHelper.GetFileAsByteArray(theUpload);
CloudFile theCloudFile = rootDir.GetFileReference(theUpload.Name);
Stream theMemoryStream = new MemoryStream(theFile);
await theCloudFile.UploadFromStreamAsync(theMemoryStream);
或者,如果我對此考慮過度,並且有更好的方法,我將不勝感激。
謝謝,
關於如何驗證文件完整性的問題在這里有一個流行的、公認的答案:
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.