Forum Discussion

YKatz's avatar
YKatz
New member | Level 2
7 years ago
Solved

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

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.
  • 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's avatar
      YKatz
      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. 

      • Greg-DB's avatar
        Greg-DB
        Icon for Dropbox Staff rankDropbox Staff

        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. 

About Dropbox API Support & Feedback

Node avatar for Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.5,950 PostsLatest Activity: 15 hours ago
352 Following

If you need more help you can view your support options (expected response time for an email or ticket is 24 hours), or contact us on X or Facebook.

For more info on available support options for your Dropbox plan, see this article.

If you found the answer to your question in this Community thread, please 'like' the post to say thanks and to let us know it was useful!