IoT中心-最大上传文件大小

时间:2019-03-21 06:30:38

标签: azure azure-storage iot azure-iot-hub

通过IoT中心上传的文件的最大大小是多少?是否像最大邮件大小一样为256KB(根据documentation

1 个答案:

答案 0 :(得分:2)

如果您使用的是IoT枢纽设备SDK中的File Upload功能,那么您将上传到Blob存储。

Current size limit of a block blob is 4.75 TiB.

Sample code:

private static async void SendToBlobAsync()
{
    string fileName = "image.jpg";
    Console.WriteLine("Uploading file: {0}", fileName);
    var watch = System.Diagnostics.Stopwatch.StartNew();

    using (var sourceData = new FileStream(@"image.jpg", FileMode.Open))
    {
        await deviceClient.UploadToBlobAsync(fileName, sourceData);
    }

    watch.Stop();
    Console.WriteLine("Time to upload file: {0}ms\n", watch.ElapsedMilliseconds);
}

deviceClient是您的IoT中心客户端(设备)。