cancel
Showing results for 
Search instead for 
Did you mean: 
Announcements
Update: Find information on Dropbox support during COVID-19 here
Close
cancel
Showing results for 
Search instead for 
Did you mean: 

Chunk upload of expanding file on iOS

Eric C.29 New member | Level 1
New member | Level 1

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 2

Re: Chunk upload of expanding file on iOS

Dropboxer
Dropboxer

[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.)

Re: Chunk upload of expanding file on iOS

Eric C.29 New member | Level 1
New 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.

Work Smarter with Dropbox

The way we work is changing. Share and discover new ways to work smarter with Dropbox in our community.

Sound good? Let's get started.
Who's talking

Top contributors to this post

What do Dropbox user levels mean?
Need more support?