cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements
Are you interested in hearing how one of our Community members uses Dropbox for sailing trips? Read all about it 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: 

Path Not Found Error

Path Not Found Error

wwaag76
Helpful | Level 6
Go to solution

New user here just working through the tutorial  https://www.dropbox.com/developers/documentation/dotnet#tutorial  When I generate a token using an app for Full Dropbox, it works OK.  However, if I generate a token using an app for an App Folder only, I get an error that the path could not be found when calling download.

Here is my test code.  I've tried replacing "/HappyOtterInstaller" with "", but I get the same error.  Could you point me in the right direction.  Thanks.

wayne

 

using (var dbx = new DropboxClient("blahblah"))
            {
                var full = await dbx.Users.GetCurrentAccountAsync();                
                Console.WriteLine("{0} - {1}", full.Name.DisplayName, full.Email);
                Console.WriteLine("Press enter to close...");
                Console.ReadLine();
                await ListRootFolder(dbx);
                Console.WriteLine("Press enter to close...");
                Console.ReadLine();                
                await Download(dbx, "/HappyOtterInstaller", "currentBuild.txt");                
                Console.WriteLine("Download__Press enter to close...");
                Console.ReadLine();
                await Upload(dbx, "/HappyOtterInstaller", "currentBuild.txt", @"F:\ww.txt");
                Console.WriteLine("Press enter to close...");
                Console.ReadLine();
            }


1 Accepted Solution

Accepted Solutions

wwaag76
Helpful | Level 6
Go to solution

Problem solved.  Didn't understand that the App folder was created under the main folder Apps. Now working OK.  Thanks.

View solution in original post

9 Replies 9

chirstius
Dropbox Staff
Go to solution

Hey @wwaag76,

 

Would you mind showing the actual code within your methods that are failing? I assume things are erroring out at the call to ListRootFolder()?

 

Can you show the contents of that method?

 

Typically errors that occur with pathing between full access and App Folder access are not honoring the fact that App Folder apps are effectively chroot'd to their App Folder - so as an example: /Apps/HappyOtterInstaller IS your root, all paths you want to reference are relative to that path as root. So the folder: /Apps/HappyOtterInstaller/install.exe is referred to as just /install.exe by your app. But since you say you tried passing an empty string for path (which always translates to root) I would think just listing files would work.

Seeing the code might help figure out if there's another issue at play.

 

Thanks,

 

-Chuck

wwaag76
Helpful | Level 6
Go to solution

I assume things are erroring out at the call to ListRootFolder()?

No, it gets past that call.  It's the Download call that produces the error.  Here's the code for the Download method.

 

async Task Download(DropboxClient dbx, string folder, string file)
            {
                using (var response = await dbx.Files.DownloadAsync(folder + "/" + file))
                //using (var response = await dbx.Files.DownloadAsync(file))
                {
                    Console.WriteLine(await response.GetContentAsStringAsync());
                }
            }

wwaag76
Helpful | Level 6
Go to solution

One other thing.  Inside the app looks like this.

dbinstall.png

wwaag76
Helpful | Level 6
Go to solution

Problem solved.  Didn't understand that the App folder was created under the main folder Apps. Now working OK.  Thanks.

ABDUL_REHMAN
New member | Level 2
Go to solution

I use this code as well but get the same error. I use code following as :

 async Task Download(DropboxClient dbx, string folder, string file)
        {
            using (var response = await dbx.Files.DownloadAsync(folder + "/" + file))
            {
                Console.WriteLine(await response.GetContentAsStringAsync());
            }
        }

and Pass perameters like :

await Download(client, "/Apps/Retailme", "Retailme.exe");

But there is same error path/not_found

Greg-DB
Dropbox Staff
Go to solution

[Cross-linking for reference: https://stackoverflow.com/questions/61527512/dropbox-file-download-error-path-not-found-using-c-shar... ]

 

@ABDUL_REHMAN If you're using an app with the "app folder" permission, you don't need to include the path of the app folder itself when making API calls, such as "/Apps/Retailme". The Dropbox API will automatically interpret your paths as being relative to your app folder. 

 

So, for example, in your code you wouldn't need to include that "/Apps/Retailme". With how that code snippet is set up, you would instead specify a "folder" value of "", which would result in the final path of "/Retailme.exe" for a file inside your app folder.

raiam
New member | Level 2
Go to solution

can you elaborate on what was the final path url?

i created mine called: "implementation-dev"

 

but I am getting `path/not_found/`, I tried: /home/Apps/implementation-dev, [Company]/Apps/implementation-dev, /implementation-dev, but.nothing works

Здравко
Legendary | Level 20
Go to solution

Hi @raiam,

Just list the content with empty path and follow whatever appear there. 😉 All entries have their paths set and theses paths are mandatory correct, so you can use them as they are (just copy/paste).

Hope this helps.

Greg-DB
Dropbox Staff
Go to solution

@raiam I see you also opened a new thread for this, so we'll follow up with you there.

Need more support?
Who's talking

Top contributors to this post

  • User avatar
    Greg-DB Dropbox Staff
  • User avatar
    Здравко Legendary | Level 20
  • User avatar
    raiam New member | Level 2
  • User avatar
    ABDUL_REHMAN New member | Level 2
What do Dropbox user levels mean?