简体   繁体   English

如何使用WindowsAzure.Storage.DataMovement?

[英]How to use WindowsAzure.Storage.DataMovement?

 TransferManager.UploadAsync(@"C:\data2.flac",
                             destinationBlob,
                             null,
                             context,
                             CancellationToken.None).Wait();

This code perfectly works when I upload to block blob storage. 当我上传到block blob存储时,此代码完美工作。

How can I use WindowsAzure.Storage.DataMovement when I upload to page blob ? 上传到page blob时如何使用WindowsAzure.Storage.DataMovement

Now I get 现在我明白了

Unhandled Exception: System.AggregateException: One or more errors occurred. ---> Microsoft.WindowsAzure.Storage.DataMovement.TransferException: File size 274.02MB is invalid for PageBlob, must be a multiple of 512 bytes.

As the error message states, in order to upload a file as page blob the size of the file must be a multiple of 512 bytes. 如错误消息所述,为了将文件上传为页面Blob,文件的大小必须为512字节的倍数。 Because your file does not match this criteria, your upload is failing. 由于您的文件不符合此条件,因此上传失败。 You would need to specify a file which matches this size restriction. 您需要指定一个与此大小限制匹配的文件。

The reason there's this size restriction is because you mount these page blobs as drives and use them with your Virtual Machines. 出现此大小限制的原因是因为您将这些页面Blob挂载为驱动器,并将其与虚拟机一起使用。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何判断Microsoft.WindowsAzure.Storage.DataMovement.TransferManager的CopyDirectoryAsync完成了? - How can I tell when CopyDirectoryAsync from Microsoft.WindowsAzure.Storage.DataMovement.TransferManager has finished? 我应该使用哪个版本的WindowsAzure.Storage? - Which version of WindowsAzure.Storage should I use? 如何在Visual Studio 2013中安装WindowsAzure.Storage? - How do I install WindowsAzure.Storage in Visual Studio 2013? 如何用 Microsoft.Azure.Storage.Blob 替换 Microsoft.WindowsAzure.Storage - How to replace Microsoft.WindowsAzure.Storage with Microsoft.Azure.Storage.Blob 从“WindowsAzure.Storage”迁移时,我应该为 Azure 表使用什么 package - What package should I use for Azure Tables when migrating away from "WindowsAzure.Storage" OperationContext 使用情况 (Microsoft.WindowsAzure.Storage) - OperationContext usage (Microsoft.WindowsAzure.Storage) 如何将字符串转换为 Microsoft.WindowsAzure.Storage.Table.ITableEntity? - How can i convert a string to Microsoft.WindowsAzure.Storage.Table.ITableEntity? 在WindowsAzure存储帐户上调用InitializeCache时出错 - Error Calling InitializeCache on WindowsAzure Storage Account ExecuteQuery WindowsAzure.Storage 5.0.3没有扩展方法 - ExecuteQuery WindowsAzure.Storage 5.0.3 no extension method WindowsAzure.Storage没有使用.Net Core 1.0 - WindowsAzure.Storage on not working on .Net Core 1.0
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM