cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements
Want to learn some quick and useful tips to make your day easier? Check out how Calvin uses Replay to get feedback from other teams at Dropbox here.

Dropbox API Support & Feedback

Find help with the Dropbox API from other developers.

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Chunk upload of expanding file on iOS

Chunk upload of expanding file on iOS

Eric C.29
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

Greg-DB
Dropbox Staff

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

Need more support?
Who's talking

Top contributors to this post

  • User avatar
    Eric C.29 New member | Level 1
  • User avatar
    Greg-DB Dropbox Staff
What do Dropbox user levels mean?