0

i am using Alamofire 5.4.1 to cancel a download request and save the data to a file. 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?

random_user
  • 73
  • 1
  • 6

1 Answers1

0

This is expected, as resumeData does not last forever. 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.

Jon Shier
  • 12,200
  • 3
  • 35
  • 37