[英]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支持Java的Azure IoT服务SDK ,包括
FileUploadNotification
, FileUploadNotificationReceiver
等。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.