We’re Still Here to Help (Even Over the Holidays!) - find out more here.
Forum Discussion
Henk Martijn L.
11 years agoNew member | Level 1
SwiftyDropbox - Keep track of send/received data
Hello!
First of all, great job! I just played with the SwiftyDropbox on API v2 for a few days and I must say it's really easy to get it all working.
I have one question though.
What would be the best way to send multiple files and keep track of that progress? Since at the moment I'm calling client.filesUpload(path: "\(path)/\(file)", body: data).response { response, error in ... in a for in loop. In some way it caches all the files (since the for in is done in a second) and sends them after each other to dropbox. This way it's really hard to track the progress, since it will give a success after every file. Of course I can put a counter to it and add it every success, but that just looks messy ;)
Also, can we expect a function to send multiple files as well in the future?
Thanks for the great API!
5 Replies
Replies have been turned off for this discussion
- Leah C.111 years agoNew member | Level 1
Thanks! How about trying an upload session where you can upload each file in chunks?
The SDK contain methods forfilesUploadSessionStart,filesUploadSessionAppend, andfilesUploadSessionFinish: https://github.com/dropbox/SwiftyDropbox/blob/master/Source/Files.swift#L1964
You'll still need to track which file you're uploading using the sessionId returned fromfilesUploadSessionStartbut you'll have some idea of how much of each file has been uploaded. - Henk Martijn L.11 years agoNew member | Level 1
Thanks I'll check it out!
- David E.4110 years agoNew member | Level 1
Hello there,
Is there a way to get download progress?
- Greg-DB10 years ago
Dropbox Community Moderator
Hi David, it looks like you also posted this on StackOverflow, so I've answered there:
https://stackoverflow.com/questions/35659454/swiftydropbox-download-progress/35659995#35659995
(For reference, I believe this works for uploads too, but for uploading large files upload sessions, as Leah referred to, are preferred anyway.)
- David E.4110 years agoNew member | Level 1
It works great, thanks!
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!