cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements
Want to learn some quick and useful tips to make your day easier? Check out how Calvin uses Replay to get feedback from other teams at Dropbox here.

Dropbox API Support & Feedback

Find help with the Dropbox API from other developers.

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

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

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

YKatz
New member | Level 2
Go to solution

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

Greg-DB
Dropbox Staff
Go to solution

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. 

View solution in original post

4 Replies 4

Greg-DB
Dropbox Staff
Go to solution

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

YKatz
New member | Level 2
Go to solution

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. 

Greg-DB
Dropbox Staff
Go to solution

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. 

YKatz
New member | Level 2
Go to solution
Hi Greg,

Thanks for the code example, I've managed to get it working on my end.
Need more support?