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: 

How to cancel the uploading process in API V.2(C-Objective) ?

How to cancel the uploading process in API V.2(C-Objective) ?

comb
Explorer | Level 3
Go to solution

Hello,

 

In version API v.1 we have used the folowing APIs:

 

- (void)restClient:(DBRestClient *)client uploadedFileChunk:(NSString *)uploadId newOffset:(unsigned long long)offset (to send a larcge file)
[[self restClient] cancelAllRequests] (to cancel the uploading process)

 

In version API v.2 wa are using the folowing APIs:
uploadSession (to send a large file)


how to cancel the uploading process in the version API v.2?

 

Thanks in advance!

 

1 Accepted Solution

Accepted Solutions

Greg-DB
Dropbox Staff
Go to solution

The API v2 Objective-C SDK doesn't have a method like cancelAllRequests to cancel all active requests at once, but I'll be sure to pass this along as a feature request. 

 

When using upload sessions though, since you control how and when each portion is uploaded, you can have your app stop the upload session by stopping further calls.

 

And in any case, you can cancel an individual upload call (when using upload sessions or not) by calling cancel on the call object itself, like this:

 

DBUploadTask *req = [client.filesRoutes upload...
[req cancel];

(Note that there's a bug with that in 2.0.6, so you may want to use 2.0.5 for now to do this.)

View solution in original post

2 Replies 2

Greg-DB
Dropbox Staff
Go to solution

The API v2 Objective-C SDK doesn't have a method like cancelAllRequests to cancel all active requests at once, but I'll be sure to pass this along as a feature request. 

 

When using upload sessions though, since you control how and when each portion is uploaded, you can have your app stop the upload session by stopping further calls.

 

And in any case, you can cancel an individual upload call (when using upload sessions or not) by calling cancel on the call object itself, like this:

 

DBUploadTask *req = [client.filesRoutes upload...
[req cancel];

(Note that there's a bug with that in 2.0.6, so you may want to use 2.0.5 for now to do this.)

Greg-DB
Dropbox Staff
Go to solution

The override issue in 2.0.6 is fixed now in version 3.0.0.

Need more support?
Who's talking

Top contributors to this post

  • User avatar
    Greg-DB Dropbox Staff
What do Dropbox user levels mean?