简体   繁体   English

无法从 resumeData 恢复下载:Alamofire

[英]unable to resume download from resumeData: Alamofire

i am using Alamofire 5.4.1 to cancel a download request and save the data to a file.我正在使用 Alamofire 5.4.1 取消下载请求并将数据保存到文件中。 which is then copied to a different folder.然后将其复制到不同的文件夹。 I later try and resume the task to download with the data loaded from the file in the new location and i get an error stating that it cannot create download file from resume task..我稍后尝试恢复任务以使用从新位置的文件加载的数据进行下载,我收到一条错误消息,指出它无法从恢复任务创建下载文件。

I get the following error:我收到以下错误:

2021-04-12 21:34:36.251586-0700 App[20318:4366697] __NSCFLocalDownloadFile: error 2 opening resume file: /private/var/mobile/Containers/Data/Application/96D862DB-6874-4E2A-990B-816531EC3FFE/tmp/CFNetworkDownload_soxi5K.tmp
2021-04-12 21:34:36.251781-0700 App[20318:4366697] Task <F203101E-84CD-4389-AFE9-4D4CCEE5AD57>.<1> cannot create download file from resume data

any pointers/suggestions would be appreciated?任何指示/建议将不胜感激?

This is expected, as resumeData does not last forever.这是意料之中的,因为resumeData不会永远持续下去。 Your partial download sits in temporary storage until you either complete the download and move it or the system deletes it.您的部分下载内容位于临时存储中,直到您完成下载并移动它或系统将其删除。 If you wait too long the system may reclaim the disk space by deleting the partial download.如果您等待的时间过长,系统可能会通过删除部分下载来回收磁盘空间。 You can see this in Apple's documentation .您可以在Apple 的文档中看到这一点。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM