点击或拖拽改变大小

MqttSyncClientUploadFile 方法 (Stream, String, String, String, ActionInt64, Int64, HslCancelToken)

[文件引擎] 上传流给服务器,需要指定流,服务器保存的名字,以及上传到服务器的分类信息,支持进度汇报功能。
[File Engine] To upload a stream to the server, you need to specify the stream, the name saved by the server, and the classification information uploaded to the server to support the progress reporting function.

命名空间:  HslCommunication.MQTT
程序集:  HslCommunication (在 HslCommunication.dll 中) 版本:11.8.2.0 (11.8.2.0)
语法
public OperateResult UploadFile(
	Stream stream,
	string groups,
	string serverName,
	string fileTag,
	Action<long, long> processReport,
	HslCancelToken cancelToken = null
)

参数

stream
类型:System.IOStream
groups
类型:SystemString
文件的类别,例如 Files/Personal/Admin 按照斜杠来区分
serverName
类型:SystemString
文件的额外的描述信息
fileTag
类型:SystemString

[缺少 "M:HslCommunication.MQTT.MqttSyncClient.UploadFile(System.IO.Stream,System.String,System.String,System.String,System.Action{System.Int64,System.Int64},HslCommunication.Core.HslCancelToken)" 的 <param name="fileTag"/> 文档]

processReport
类型:SystemActionInt64, Int64
进度报告,第一个参数是已完成字节数,第二个参数是总字节数
cancelToken (Optional)
类型:HslCommunication.CoreHslCancelToken
取消上传操作的令牌

返回值

类型:OperateResult
是否上传成功的结果对象
参见