Loreno
Loreno

Reputation: 668

IoT Hub - maximum uploaded file size

What is the maximum size of a file uploaded through IoT Hub? Is it 256KB like the maximum message size (according to documentation)

Upvotes: 0

Views: 973

Answers (1)

evilSnobu
evilSnobu

Reputation: 26324

You're uploading to blob storage if you're using the File Upload functionality in the IoT Hub Device SDK .

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 is your IoT Hub client (device).

Upvotes: 2

Related Questions