I'm using Alamofire to download large files in my ios project.
When i cancel a download request (that is currently downloading a large file to disk) - this request produces resumeData
with the data downloaded so far - but I would like a responseURL
with the URL of the file with the partially downloaded data. I plan to use the responseURL serializer at the end to never load the entire data in memory - but if I want to suspend and resume downloads - then this is forcing me to load the data in memory.
there's a fileURL
in the download request - but the documentation states that this is populated after the download has finished.
any pointers/suggestions would be appreciated?
As explained on GitHub, resumeData
only includes the data necessary to resume a download, not the actual download data itself, so it's perfectly safe to keep it around in memory. You can parse the value to get the URL
of the partially downloaded data, but it's not a formatted encoding, so it's not really appropriate for Alamofire to parse it directly.