download
public final Unit download(String fileUniqueId, String fileUrl, String fileName, String path, DownloadMediaFileHandler handler)
Download file (Supports resumable Pass).
Usage Example:
message.download(
fileUniqueId = "unique-id",
fileUrl = "https://example.com/file.pdf",
fileName = "document.pdf",
path = "/sdcard/Download/",
handler = object : DownloadMediaFileHandler {
override fun onFileNameChanged(newFileName: String) { /* File name Change */}
override fun onSuccess() { /* 下载成功 */}
override fun onProgress(progress: Int) { /* 进度更新 */}
override fun onError(error: NCError) { /* 下载失败 */}
override fun onCanceled() { /* 下载取消 */}
}
)Content copied to clipboard
Parameters
file Unique Id
File unique identifier
file Url
文件下载地址
file Name
文件名
path
文件下载保存目录
handler
下载回调