Download a file in a File Provider Extension in iOS

I am developing a cloud-based application and have integrated the FileProviderExtension. However, files larger than 20 MB are not downloading as it’s throwing a memory limit exception. In this process I have downloaded the file data but after downloaded data need to decompression the data . I am getting memory limit exception during decompression. I am using below file to decompress the data.

let decompressedData = try? decryptedChunkBytes?.gunzipped()

Given its memory limits, a File Provider extension should avoid trying to hold the entire contents of the file in memory. You can either download to a file or, if appropriate for your platform, download piecemeal using the URLSession delegate mechanism. And if you need to uncompress, do that using a streaming uncompressor.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

Download a file in a File Provider Extension in iOS
 
 
Q