Uploads a file to a Blob storage in chunks, fed through the callback function provided by the user.


#include "azure-iot-sdk-c/iothub_client/inc/iothub_device_client.h"

IOTHUB_CLIENT_RESULT IoTHubDeviceClient_UploadMultipleBlocksToBlobAsync(
  IOTHUB_DEVICE_CLIENT_HANDLE                     iotHubClientHandle,
  const char *                                    destinationFileName,
  void *                                          context


This function allows users to upload large files in chunks, not requiring the whole file content to be passed in memory.


  • iotHubClientHandle The handle created by a call to the IoTHubDeviceClient_Create function.

  • destinationFileName The name of the file to be created in Azure Blob Storage.

  • getDataCallbackEx A callback to be invoked to acquire the file chunks to be uploaded, as well as to indicate the status of the upload of the previous block.

  • context Any data provided by the user to serve as context on getDataCallback.

Return Value

An IOTHUB_CLIENT_RESULT value indicating the success or failure of the API call.