Announcements
Known issues updated. Learn more

Can't upload file to a shared folder in Dropbox Business

New member | Level 2

I am having difficulty uploading a file to any shared folders that I currently has access to (and I can see my access via .Sharing.ListFoldersAsync()). Regardless of how I change the path in Files.UploadAsync(), the file will always go to a member's personal/root folder, not our shared folder.

 

Is there a way to upload files to a shared folder or is that not an available function in the api at this time?

 

 

The app is based on the SimpleTest app (v2) that is available under Dropbox for .NET Developers page.

 

Access Type:

  • "Full Dropbox" listed under the Connected apps page.
  • "Team member file access" under the Team apps page.
1 Accepted solution

Accepted Solutions

Re: Can't upload file to a shared folder in Dropbox Business

Dropboxer

To be clear, can you confirm if you are referring to the "team space" I mentioned? (If not, and you just want to upload to a share folder mounted inside your member folder, you can use the path from Sharing.ListFoldersAsync.)

 

If you are trying to upload to the team space, once you know the namespace ID, you can use that as the path root. With the .NET SDK you can operate on the team space by setting the "Dropbox-API-Path-Root" header. The .NET SDK supports setting the Dropbox-Api-Path-Root header, via DropboxClient.WithPathRoot.

You can access the team shared space by using DropboxClient.WithPathRoot to set Dropbox-Api-Path-Root header:

this.client = this.client.WithPathRoot(new PathRoot.NamespaceId(<namespace ID>));

 

Otherwise, please share the code and output that isn't working for you so I can get a better idea of what you're trying to do specifically. 

Reply
Loading...
4 Replies

Re: Can't upload file to a shared folder in Dropbox Business

Dropboxer

It sounds like you're referring to accessing the "team space". We have a namespace guide here that covers how to access that via the API:

 

https://www.dropbox.com/developers/reference/namespace-guide

Reply
Loading...

Re: Can't upload file to a shared folder in Dropbox Business

New member | Level 2

Hi Greg,

 

Okay I am able to access the shared folders using Team.NamespacesListAsync() but NamespaceMetadata doesn't provide any file path to use in order to upload files to it. 

Reply
Loading...

Re: Can't upload file to a shared folder in Dropbox Business

Dropboxer

To be clear, can you confirm if you are referring to the "team space" I mentioned? (If not, and you just want to upload to a share folder mounted inside your member folder, you can use the path from Sharing.ListFoldersAsync.)

 

If you are trying to upload to the team space, once you know the namespace ID, you can use that as the path root. With the .NET SDK you can operate on the team space by setting the "Dropbox-API-Path-Root" header. The .NET SDK supports setting the Dropbox-Api-Path-Root header, via DropboxClient.WithPathRoot.

You can access the team shared space by using DropboxClient.WithPathRoot to set Dropbox-Api-Path-Root header:

this.client = this.client.WithPathRoot(new PathRoot.NamespaceId(<namespace ID>));

 

Otherwise, please share the code and output that isn't working for you so I can get a better idea of what you're trying to do specifically. 

Reply
Loading...

Re: Can't upload file to a shared folder in Dropbox Business

New member | Level 2
Hi Greg,

Thanks for the code example, I've managed to get it working on my end.
Reply
Loading...
API Support

Have a question? Our Dropbox Community is here to help you find an answer!
You won’t have to wait too long for a reply, but why not learn more about the Community while you’re here.

Not the right discussion for you? Find out what else our Community has to say about API Support.

Or, search our Help Center for even more.

Who's talking
Top contributors to this post