NSURLSessionUploadTask offset file upload on retry

327 views Asked by At

I have to design something that reacts to connectivity loss to the server and supports uploading in the background on iOS.

If the upload fails due to a connectivity loss, it should start again from the offset where it failed.

I have the ability to ask the server if it has part of the file or how much of the file it has.

Is there a way to offset the streaming upload to a specific byte in the file?

1

There are 1 answers

0
Clay Bridges On

As of iOS 8, AFAIK, you cannot stream uploads in the background on iOS. You must provide a file to upload, which is then hard-linked by the system, and handed to nsurlsessiond. This is hard-won knowledge, but I've never found this explicitly stated in the Apple documentation.