tim
tim

Reputation: 1369

Dropbox c# SDK how to upload to a folder shared with me

Someone in my org has shared a Dropbox folder with me. I wish to use the Dropbox .Net SDK to upload files. I can see the folder with Sharing.ListFoldersAsync(). If I try to upload it just puts creates a folder with the same name on my account and nothing is put in the shared folder.

Upvotes: 0

Views: 40

Answers (1)

Greg
Greg

Reputation: 16930

When uploading, for example using UploadAsync, you need to set the correct path for the destination file path, including any parent folder(s).

You can see the path for a shared folder in the SharedFolderMetadata.pathLower field for the shared folder, for example, in the result of ListFoldersAsync.

Additionally though, you need to make sure you're working in the correct root. By default, API calls to the Dropbox API operate in the "member folder" of the connected account, not the "team space". That means that by default, the contents of the team space will not be found. It sounds like the folder you're referring to may be in the team space, but if you're operating in the member folder, your API calls won't find it.

You can configure API calls to operate in the "team space" instead though, in order to interact with files/folders in the team space. To do so, you'll need to set the "Dropbox-API-Path-Root" header. You can find information on how to use this in the Team Files Guide.

Upvotes: 0

Related Questions