user990635 user990635 - 1 month ago 6
C# Question

Upload files to a specific folder in dropbox

I was using this example to upload files to dropbox:


http://cgeers.com/2012/03/11/dropbox-rest-api-part-5-file-upload/


Which is:

public FileSystemInfo UploadFile(string root, string path, string file)
{
//...
}



The method has 3 parameters:

root: The root relative to which the path is specified. Valid values
are sandbox and dropbox.

path: The path to the file you want to
upload.

file: Absolute path to the local file you want to upload

Call this method as follows:


var file = api.UploadFile("dropbox", "photo.jpg", @"C:\Pictures\photo.jpg");


Dropbox API says exactly the same as the example:


https://www.dropbox.com/developers/core/docs#files-POST


So no mentioning of "parent folder"..

How can I upload files under a specific folder instead of the root?

Answer

cant you just do

var file = api.UploadFile("dropbox", @"myfolder\photo.jpg", @"C:\Pictures\photo.jpg");