We Want to Hear From You! What Do You Want to See on the Community? Tell us here!
Forum Discussion
Christian T.16
10 years agoNew member | Level 1
swifty dropbox download cancel
how can I cancel a file download in progress through the API? thanks.
12 Replies
- Greg-DB10 years ago
Dropbox Community Moderator
Unfortunately the SwiftyDropbox SDK doesn't currently offer a way to cancel uploads, but I'll pass this along as a feature request.
- Christian T.1610 years agoNew member | Level 1
thanks, so no cancel for downloads or uploads?
- Greg-DB10 years ago
Dropbox Community Moderator
Oh, apologies, I meant to say downloads. But that's correct, there isn't currently a way to cancel either.
- Gabriel N.210 years agoNew member | Level 1
This seems to me like a huge oversight from your part. When can we expect an api fix as we have a release coming soon? Without a way to cancel a download this SDK is not suitable for displaying a list of thumbnails in a tableview/collectionview without firing a ton of download requests with no way of stopping them when the cells get out of view.
We integrated this api and now we see that we have to remove it.
I propose to either expose the NSURLRequest directly or to use something similar to Apple's Photos api where a request returns an ID, that one can store as the cell's tag or similar, and then provide a function to cancel a request by ID. Then it will all look quite nicely in cellForItemAtIndexPath:
[...]
if cell.tag != 0 {
client?.files.cancelRequest(DropBoxRequestID(cell.tag))
}
cell.tag = Int(client.files.getThumbnail([...])
[...]
- Greg-DB10 years ago
Dropbox Community Moderator
Thanks for the feedback! I don't have a timeline for when this might be implemented, but I'll be sure to add your vote to the feature request.
By the way, the SDK is open-source, so you can modify it as desired:
- Greg-DB9 years ago
Dropbox Community Moderator
Quick follow up here, in the latest versions of SwiftyDropbox, upload/download request objects do now offer a `cancel` method you can call to cancel the request.
- Jiho P.9 years agoExplorer | Level 3
Hi, adding to an old thread, but is this implemented for Objective C Library?
When I try to use cancel(), the app crashes with:
Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'You must override cancel in a subclass'
Thanks!
- Greg-DB9 years ago
Dropbox Community Moderator
Hi Jiho, yes, this is available in the Objective-C SDK, but that's a known issue in version 2.0.6 in particular. You can use 2.0.5 as a workaround for now. - Jiho P.9 years agoExplorer | Level 3
Okay, that worked for now.
- Greg-DB9 years ago
Dropbox Community Moderator
The override issue in 2.0.6 is fixed now in version 3.0.0.
About Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.6,034 PostsLatest Activity: 2 hours ago
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 or Facebook.
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!