Anand Suthar
Anand Suthar

Reputation: 3798

DropBox file upload using core api https://api-content.dropbox.com/1/files/<root>/<path>

I am integrating dropbox in my app using OAuth 2.0 and now I want to upload a image using it's core api https://api-content.dropbox.com/1/files//

my problem is there is no parameter shown for file upload (where i can send NSData)

DropBox documentation link :- https://www.dropbox.com/developers/core/docs ( /files (POST) )

I don't want to upload file/image using DBRestClient because it requires two time of login one via webView (OAuth 2.0) and another one via it's internal framework and my app require OAuth 2.0 integration.

Upvotes: 0

Views: 1172

Answers (1)

Tobias
Tobias

Reputation: 7771

Look closer. The documentation says:

Request body: "The file contents to be uploaded. Since the entire POST body will be treated as the file, any parameters must be passed as part of the request URL. The request URL should be signed just as you would sign any other OAuth request URL."

So you need to upload the actual contents through the message body (where the POST data would go).

However, the documentation also recommends to use /files_put instead.

Upvotes: 1

Related Questions