MsgDownloadElemToPath
introduction
Download message elements
Download message elements including image, file, sound and video. Fields like msg_download_elem_param_flag、msg_download_elem_param_id、msg_download_elem_param_business_id、msg_download_elem_param_url can be found in the element. And msg_download_elem_param_type is download type TIMDownloadType, the path must be UTF-8 encoded.
Parameter details
overload1
Parameter name | Parameter type | Required | Description |
---|---|---|---|
download_param | DownloadElemParam | Required | DownloadElemParam |
path | string | Required | Local path |
callback | ValueCallback< MsgDownloadElemResult > | Required | Asynchronous callback The format of json_param in the return value is json |
overload2
Parameter name | Parameter type | Required | Description |
---|---|---|---|
download_param | DownloadElemParam | Required | DownloadElemParam |
path | string | Required | Local path |
callback | ValueCallback< string > | Required | Asynchronous callback The format of json_param in the return value is string |
Returned template
TIMResult
The parameters of the callback function after successfully calling the API:
code:int
desc:string
json_param:
'{
"msg_download_elem_result_current_size" : 10,
"msg_download_elem_result_total_size" : 100
}' // For the meaning of Json Key, please refer to [MsgDownloadElemResult]
user_data:string
Return value details
name | type | description |
---|---|---|
TIMResult | TIMResult | Return value of calling API |
code | int | Result error code: Error Codes |
desc | string | The description of the error. |
json_param | string | Json string. Calling different API will get different Json strings. For the meaning of Json Key, please refer to MsgDownloadElemResult |
user_data | string | User-defined data transfered by ImSDK without any processing |