downloadFile method
下载文件
Implementation
Future<void> downloadFile(
{required String fileId,
required String savePath,
void onProcess(int count, int total)?}) async {
_checkParams("fileId", "fileId required");
List<String> fileIds = [fileId];
CloudBaseStorageRes<List<DownloadMetadata>> res =
await getFileDownloadURL(fileIds);
String? url = res.data[0].downloadUrl;
if (url == null) {
throw new CloudBaseException(
code: CloudBaseExceptionCode.FILE_NOT_EXIST,
message: 'File Not Exist');
}
await _request.download(url, savePath, onProcess);
}