Upload file in 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 uploading, as it's throwing a memory limit exception.

Error: Thread 28: EXC_RESOURCE (RESOURCE_TYPE_MEMORY: high watermark memory limit exceeded) (limit=20 MB)

Answered by Engineer in 769547022

FileProvider app extension processes have a 20 MB memory limit on iOS.

You will need to find a method to upload the file, which is not loading the entire file into memory.

Look into this one: https://developer.apple.com/documentation/foundation/nsurlsession/1411550-uploadtaskwithrequest

Presumably you’re using URLSession for this. Which specific API did you use to create your upload task?

Share and Enjoy

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

I'm encountering the same error when attempting to download a file that's larger than 15 MB.

There are many methods containing the phrase uploadTask. I’d like to know which one you’re using.

Share and Enjoy

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

Accepted Answer

FileProvider app extension processes have a 20 MB memory limit on iOS.

You will need to find a method to upload the file, which is not loading the entire file into memory.

Look into this one: https://developer.apple.com/documentation/foundation/nsurlsession/1411550-uploadtaskwithrequest

Upload file in File Provider Extension in iOS
 
 
Q