0

I need to add on my web page possibility for users to upload some document on my site from his Dropbox. Can you give me any hints how I can achieve this. I tried to google the subject but without any success

Andrey
  • 160
  • 1
  • 9

1 Answers1

1

Here is the DropBox Core API documentation

After checking Authorization

Uploads a file using PUT semantics. Note that this call goes to content.dropboxapi.com instead of api.dropboxapi.com.

The preferred HTTP method for this call is PUT. For compatibility with browser environments, the POST HTTP method is also recognized.

Note: Providing a Content-Length header set to the size of the uploaded file is required so that the server can verify that it has received the entire file contents.

URL STRUCTURE https://content.dropboxapi.com/1/files_put/auto/?param=val path The full path to the file you want to write to. This parameter should not point to a folder. param=val The URL-encoded parameters for this request. They cannot be sent in the request body. METHOD PUT, POST REQUEST BODY required The file contents to be uploaded. Since the entire PUT 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.

PARAMETERS locale The metadata returned on successful upload will have its size field translated based on the given locale. overwrite This value, either true (default) or false, determines whether an existing file will be overwritten by this upload. If true, any existing file will be overwritten. If false, the other parameters determine whether a conflict occurs and how that conflict is resolved. parent_rev If present, this parameter specifies the revision of the file you're editing. If parent_rev matches the latest version of the file on the user's Dropbox, that file will be replaced. Otherwise, a conflict will occur. (See below.) If you specify a parent_rev and that revision doesn't exist, the file won't save (error 400). You can get the most recent rev by performing a call to /metadata. autorename This value, either true (default) or false, determines what happens when there is a conflict. If true, the file being uploaded will be automatically renamed to avoid the conflict. (For example, test.txt might be automatically renamed to test (1).txt.) The new name can be obtained from the returned metadata. If false, the call will fail with a 409 (Conflict) response code. RETURNS The metadata for the uploaded file. More information on the returned metadata fields are available here.

Sample JSON response

{
    "size": "225.4KB",
    "rev": "35e97029684fe",
    "thumb_exists": false,
    "bytes": 230783,
    "modified": "Tue, 19 Jul 2011 21:55:38 +0000",
    "path": "/Getting_Started.pdf",
    "is_dir": false,
    "icon": "page_white_acrobat",
    "root": "dropbox",
    "mime_type": "application/pdf",
    "revision": 220823
}

Here is the API docs link DropBox Core API