cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements
Not happy with your Spotify Wrapped? Check out how Kevin on the Dropbox team used Paper to make sure he keeps discovering new music over 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: 
1
Ask
2
Comments

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

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

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

Greg-DB
Dropboxer

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

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

Greg-DB
Dropboxer

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.)

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

Greg-DB
Dropboxer

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

Who's talking

Top contributors to this post

  • User avatar
    Greg-DB Dropboxer
What do Dropbox user levels mean?
Need more support?