Can I download big image without crash
If I download big image via
self.session.dataTask(with: request, completionHandler: { [weak self] data, response, error}
image stored inside response. And I can catch crash. How can I use URLSession's method
func downloadTask(with request: URLRequest,
completionHandler: @escaping (URL?, URLResponse?, Error?) -> Void) -> URLSessionDownloadTask
to store image in file
Why do you close issue without any answer?
Hello @smolskyaleksey,
Sorry for not writing before. I haven't been able to reproduce this issue. Could you help me with additional steps to reproduce? How big was the file you were trying to download? Is this still an issue for you?
Yes, try to download big image above 100 mgb. dataTask represent image in memory in data parameter. U can crash because you don't have enough memory.
OK! Will try to reproduce, this might be caused because of limitations in URLSession so it might require us to implement background downloads in order to make this work. WIll investigate further.
OK! Will try to reproduce, this might be caused because of limitations in URLSession so it might require us to implement background downloads in order to make this work. WIll investigate further.
You can use
func downloadTask(with request: URLRequest,
completionHandler: @escaping (URL?, URLResponse?, Error?) -> Void) -> URLSessionDownloadTask
It downloads file directly in file system