We’re Still Here to Help (Even Over the Holidays!) - find out more here.
Forum Discussion
Eric C.29
11 years agoNew member | Level 1
Chunk upload of expanding file on iOS
I'm trying to use chunked uploads to "stream" a video file while it is recording. I delay about 5 seconds after recording starts to start the upload, to try to make sure the upload never catches up to the end of file until after video recording ends.
If I stop recording before the upload starts, it works fine. However, if I start uploading before recording stops, everything appears to upload fine, but the resulting video file is corrupted.
Is chunk uploading of an open (and expanding) file not supported?
...Eric...
2 Replies
Replies have been turned off for this discussion
- Greg-DB11 years ago
Dropbox Community Moderator
[Cross-linking for reference: https://stackoverflow.com/questions/31328498/ios-dropbox-sdk-chunked-upload-of-open-file ]
If I understand the scenario correctly, this should work. The chunked uploading contract doesn't need (and in a way, can't) know about the state of the local file/data. It just receives the chunks of data as you send them up. As long as you send up all of the data for the eventual file, in order, specifying the correct offset, the resulting file should be what you expect.
The documentation for /chunked_upload breaks down the flow:
https://www.dropbox.com/developers/core/docs#chunked-upload
Are you sure you're uploading the pieces of the file in the right order? Also, this would only work if the format for the file you're using is such that the data in the file never changes once it's initially written. (E.g., if some important metadata is written at the beginning of the file once the recording is complete, that finalized part won't have been uploaded to Dropbox since you already uploaded the non-final version.)
- Eric C.2911 years agoNew member | Level 1
It may be the last point you made.
The whole file is getting uploaded. It may be that the AVFoundation framework modifies the file header once the video recording is complete.
About Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.
The Dropbox Community team is active from Monday to Friday. We try to respond to you as soon as we can, usually within 2 hours.
If you need more help you can view your support options (expected response time for an email or ticket is 24 hours), or contact us on X, Facebook or Instagram.
For more info on available support options for your Dropbox plan, see this article.
If you found the answer to your question in this Community thread, please 'like' the post to say thanks and to let us know it was useful!