简体   繁体   English

如何使用Azure IoT设备sdk上传文件

[英]How do I upload a file with the Azure IoT Device sdk

I'm trying to use the Java Azure IoT device client sdk (v1.2.28) to upload files to blob storage. 我正在尝试使用Java Azure IoT设备客户端SDK(v1.2.28)将文件上传到Blob存储。 The examples show how to do this with the .net sdk but it seems like the same methods in the DeviceClient class don't exist in the java sdk. 这些示例显示了如何使用.net sdk执行此操作,但似乎Java sdk中不存在DeviceClient类中的相同方法。 Is it not possible yet with the java sdk? java sdk还不可能吗?

https://docs.microsoft.com/en-us/azure/iot-hub/iot-hub-csharp-csharp-file-upload https://docs.microsoft.com/zh-cn/azure/iot-hub/iot-hub-csharp-csharp-file-upload

I reviewed the javadocs of Azure IoT device SDK, as you said, there is not a method to upload file to blob storage. 正如您所说,我回顾了Azure IoT设备SDK的javadocs,没有一种将文件上传到Blob存储的方法。

Accoring to the document File uploads with IoT Hub and the related REST API Create File Upload Sas Uri , the feature is required the blob sas uri, so only using IoT device SDK for Java is not possible, you need to use Azure Storage Java SDK to generate a blob sas uri first to call the REST API to do it. 根据文档使用IoT中心上传文件以及相关的REST API 创建文件上传Sas Uri ,该功能是blob sas uri所必需的,因此无法使用Java的IoT设备SDK,您需要使用Azure存储Java SDK首先生成一个blob sas uri来调用REST API。

However, for the other feature to receive file upload notification, there are some classes of Azure IoT service SDK for Java to support, which include FileUploadNotification , FileUploadNotificationReceiver , etc. 但是,对于接收文件上传通知的其他功能,有一些类别的Java支持JavaAzure IoT服务SDK ,包括FileUploadNotificationFileUploadNotificationReceiver等。

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

相关问题 Box Java SDK:如何为文件上传配置HTTPUrlConnection? - Box Java SDK: How do I configure HTTPUrlConnection for file upload? Azure IoT Hub - 使用 IoT Hub 从 Azure blob 下载文件到 IoT 设备 - Azure IoT Hub - Downloading file from Azure blob using IoT Hub to an IoT device 用于从设备孪生获取所需属性的 Azure 物联网集线器设备与服务 SDK? - Azure Iot hub Device vs. Service SDK for getting desired properties from Device twin? 如何通过REST API或SDK在IoT中心中创建设备 - How to create a device in IoT Hub via REST API or SDK 从Azure IoT接收文件上传通知时出错 - Error while receiving file upload notification from Azure IoT 在 Azure IoT 中配置设备时如何发送自定义负载? - How to send custom payload while provisioning device in Azure IoT? 如何使用Android从Azure IoT中心读取设备到云的信息? - How to read device-to-cloud from Azure IoT hub with android? Azure物联网设备SDK是否支持同时连接多个设备? - Does the Azure iot device sdk support multiple devices connecting at the same time? 将云发送到设备消息Azure IoT - Sending cloud to device message Azure IoT 如何使用 java sdk 从我的语言环境上传和下载文件到 azure adls? - How to upload and download a file from my locale to azure adls using java sdk?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM