[英]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.