You might see that the Dropbox Community team have been busy working on some major updates to the Community itself! So, here is some info on what’s changed, what’s staying the same and what you can expect from the Dropbox Community overall.
Forum Discussion
ccap
7 years agoExplorer | Level 4
Download error - path not found (.NET)
My dropbox business account has the following: Folder A - My Personal User Folder Folder B - Dropbox business team folder (Let's call this "TestTeam") And .txt files named test.txt, one in each fo...
- 7 years ago
You should be passing in the PathLower value in particular when calling DownloadAsync. (For printing, PathDisplay or Name would be appropriate.)
I don't see where you're connecting this to your Download method, but make sure you're using PathLower for the actual download call. Name is only the last path component, not the full path.
If you pass in PathLower, that should work, as long as you have a client with the correct "PathRoot".
Greg-DB
Dropbox Staff
A 'path/not_found' error indicates that nothing was found at the path supplied. In this case, that's the 'path' variable in your code. It sounds like you're not providing the correct path value for the files you're attempting to access.
I can't say exactly what the correct path is in your case, without knowing the state of your Dropbox. It sounds like you're using the "team space" configuration, and API calls default to your member folder, so for example, to access a file in a folder in your member folder, the path would look like "/SomeFolderName/file.ext".
You can use ListFolderAsync and ListFolderContinueAsync to list the contents of a folder to get the paths programmatically.
I recommend reviewing the Namespace Guide and the Content Access Guide for information on how to reference and access different pieces of content. (For reference, using the .NET SDK, you can set the Dropbox-API-Path-Root Header mentioned there using DropboxClient.WithPathRoot.)
ccap
7 years agoExplorer | Level 4
Using ListFolderAsync, I can successfully iterate through my full directory and get the path for all folders and files in my root, personal user folders, as well as team folders. I can't download from the paths that I get from this list, such as "/Folder A/test.txt". I can only download from my root directory for some reason. Below is the list code I'm using to create new divs for each folder/file. Clicking a folder div takes you into the next path. Clicking a file is supposed to download that file using the current path+file name, but thats where I'm getting path not found unless I try to download the root directory file only.
private async Task<ListFolderResult> ListFolder(DropboxClient client, string path) { Debug.Print("--- Files ---"); var list = await client.Files.ListFolderAsync(path); // Show folders then files foreach (var item in list.Entries.Where(i => i.IsFolder)) { Debug.Print("D {0}/", item.Name); newFolderDiv(item.Name, item.PathDisplay); } foreach (var item in list.Entries.Where(i => i.IsFile)) { var file = item.AsFile; Debug.Print("F {0}/", item.Name); Debug.Print("Path is: " + item.PathDisplay); newFileDiv(item.Name, item.PathLower); } if (list.HasMore) { Debug.Print(" ..."); } return list; } private async Task<ListFolderResult> ListFolderInTeamSpace(DropboxClient client, string path) { // Fetch root namespace info from user's account info. var account = await client.Users.GetCurrentAccountAsync(); if (!account.RootInfo.IsTeam) { Debug.Print("This user doesn't belong to a team with shared space."); return null; } else { // Point path root to namespace id of team space. client = client.WithPathRoot(new PathRoot.Root(account.RootInfo.RootNamespaceId)); var list = await ListFolder(client, path); return list; } }
Is it possible that the path that ListFolder gets for the file isn't the same path that I can use to print? But then why does it work for the root directory... ("/test.txt")
- Greg-DB7 years agoDropbox Staff
You should be passing in the PathLower value in particular when calling DownloadAsync. (For printing, PathDisplay or Name would be appropriate.)
I don't see where you're connecting this to your Download method, but make sure you're using PathLower for the actual download call. Name is only the last path component, not the full path.
If you pass in PathLower, that should work, as long as you have a client with the correct "PathRoot".
- ccap7 years agoExplorer | Level 4
Using PathLower doesn't seem to make a difference but I'll use it anyways just to be safe.
Setting the PathRoot to HomeNamespaceId allows me to download files from my personal user folder.
Setting PathRoot to RootNamespaceId lets me download from the root (where it shows my personal folder and my business team folder) but I can't download files from the Team folder (path not found).
I'm wondering if I can continue to use a DropboxClient, Dropbox App vs Dropbox Business App and API, and what PathRoot I should be setting to access team files?
**EDIT**:
May actually be on to something - I think I was setting the wrong namespace/Pathroot when I was calling the download function. I think if I set the client Pathroom to home, I can download personal user files just fine. And if I set it to root, I can download team files fine. Let me test a bit more..
About Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.5,917 PostsLatest Activity: 2 hours ago
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!