I'm looking at using "tus" to upload large files. This protocol allows for pause and resume.
My thought is to start the upload in the foreground while the app is running. But its going to take 10 minutes and the user is bored, so they background the app. At this point, the app has sent say 100M of data (using fileUpload with a normal URLSession).
I have 30 seconds to get some background task going, so what I'd like to do is submit the file upload to a URL Session, and indicate (through some magic property) that I want the upload task to use a Range of data in the file, not the whole file.
Is this possible?
The problem is that otherwise, I have to just send the whole file, or duplicate the file more or less with the first 100M not duplicated. These are close to 1G file so prefer not to do that.
Ideas most welcome!
My thought is to start the upload in the foreground while the app is running. But its going to take 10 minutes and the user is bored, so they background the app. At this point, the app has sent say 100M of data (using fileUpload with a normal URLSession).
I have 30 seconds to get some background task going, so what I'd like to do is submit the file upload to a URL Session, and indicate (through some magic property) that I want the upload task to use a Range of data in the file, not the whole file.
Is this possible?
The problem is that otherwise, I have to just send the whole file, or duplicate the file more or less with the first 100M not duplicated. These are close to 1G file so prefer not to do that.
Ideas most welcome!
No. The lack of this feature makes it tricky to implement resumable uploads of large files because, on resuming an upload, you have to copy the file to remove the bytes that you’ve uploaded so far.Is this possible?
A filed a bug requesting that uploads support a file offset a while ago (r. 30418199) but it wouldn’t hurt if you filed your own enhancement request for this.
Share and Enjoy
—
Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@apple.com"