cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements
What’s new: end-to-end encryption, Replay and Dash updates. Find out more about these updates, new features and more here.

Discuss Dropbox Developer & API

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

SwiftyDropbox download to stream?

SwiftyDropbox download to stream?

Jon B.1
Collaborator | Level 9
Go to solution

Hi -- I'm experimenting with developing a macOS SwiftyDropbox app which downloads and uploads encrypted files, decrypting them on the fly on the user's local machine.

 

I know there's a version of the download function which returns a DownloadRequestMemory rather than a DownloadRequestFile -- does this allow streaming to a buffer?  Is there a usage example anywhere?

1 Accepted Solution

Accepted Solutions

Greg-DB
Dropbox Staff
Go to solution

The SwiftyDropbox SDK only provides the two download styles you mentioned: file and memory. You can find a basic example of each in the readme here.

 

The memory option returns the file data as a Data object (in 'response.1' in the example linked above). The SDK unfortunately doesn't offer an option for returning the data as a Stream instead, but I'll pass this along as a feature request. I can't promise if or when that might be implemented though.

View solution in original post

3 Replies 3

Greg-DB
Dropbox Staff
Go to solution

The SwiftyDropbox SDK only provides the two download styles you mentioned: file and memory. You can find a basic example of each in the readme here.

 

The memory option returns the file data as a Data object (in 'response.1' in the example linked above). The SDK unfortunately doesn't offer an option for returning the data as a Stream instead, but I'll pass this along as a feature request. I can't promise if or when that might be implemented though.

Jon B.1
Collaborator | Level 9
Go to solution

Thanks -- I think it would be a very useful feature to add!

 

Re the Data object -- is there a recommended maximum size for this kind of download, like the way uploads greater than 150Mb should be done as a session?  This will determine whether we try the Data approach and feed it through a stream, or stick with a file download and then decrypt and delete the original file.

Greg-DB
Dropbox Staff
Go to solution

There isn't a particular maximum download size recommendation in this case. (The upload request limit you mentioned is due to a particular server-side limit with respect to reliability, which doesn't apply to downloads.)

 

So, this would be up to you, likely mainly as a matter of how much memory on the device you're willing to have the app consume for this.

Need more support?
Who's talking

Top contributors to this post

  • User avatar
    Greg-DB Dropbox Staff
  • User avatar
    Jon B.1 Collaborator | Level 9
What do Dropbox user levels mean?