cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements
Back again with another edition of 'How we use Dropbox', so find out how Emma uses to-do lists to get it all done 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: 

swifty dropbox download cancel

swifty dropbox download cancel

Christian T.16
New member | Level 1

how can I cancel a file download in progress through the API? thanks.

12 Replies 12

Re: swifty dropbox download cancel

Greg-DB
Dropboxer

Unfortunately the SwiftyDropbox SDK doesn't currently offer a way to cancel uploads, but I'll pass this along as a feature request.

Re: swifty dropbox download cancel

Christian T.16
New member | Level 1

thanks, so no cancel for downloads or uploads?

Re: swifty dropbox download cancel

Greg-DB
Dropboxer

Oh, apologies, I meant to say downloads. But that's correct, there isn't currently a way to cancel either.

Re: swifty dropbox download cancel

Gabriel N.2
New 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([...])

[...]

 

 

Re: swifty dropbox download cancel

Greg-DB
Dropboxer

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:

https://github.com/dropbox/SwiftyDropbox

Re: swifty dropbox download cancel

Greg-DB
Dropboxer

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.

Re: swifty dropbox download cancel

Jiho P.
Explorer | 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!

 

 

Re: swifty dropbox download cancel

Greg-DB
Dropboxer
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.

Re: swifty dropbox download cancel

Jiho P.
Explorer | Level 3

Okay, that worked for now.

Poll
We love to learn from the educators who use Dropbox. Whether you teach kids, teens, adults or a combination of all three, we want to know what apps and integrations you use with Dropbox to help with teaching. Which of the ones below is your favorite, or most used tool?
Who's talking

Top contributors to this post

  • User avatar
    Greg-DB Dropboxer
  • User avatar
    DS6 Explorer | Level 4
  • User avatar
    Jiho P. Explorer | Level 3
What do Dropbox user levels mean?
Need more support?