cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements
Musicians, convert your MuseScore files to PDF to play music on the go! Learn more 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: Folder path not found?

Folder path not found?

morranjuke
Explorer | Level 3

Happy Weekend all. Hope you're doing well. I'm aiming to generate image url from dropbox using Development feature. I faced a challenge where the folder path is not found. I'm sure that the folder path is correct and all the images are located in that folder. Here is my snippet code in Python:

morranjuke_1-1706327299401.png

Unfortunately, I can't show the access token for you. Please find the output below.

 

morranjuke_0-1706327253336.png

 

 Would you mind share your thoughts and suggestions to me? Thank you and have a great weekend!

1 Accepted Solution

Accepted Solutions

Здравко
Legendary | Level 20

Hi @morranjuke,

Such thing could happen for variety of reasons. The information you provided is not enough for limiting them.

To be aware where you're going on, start with empty string as a path when listing the folder and navigate to the right direction. Your path may be correct, but it's not clear where your API is rooted currently (there are variety of options); unexpected rooting may make you correct path become incorrect!

When constructing your file path, you use OS related path join; that's NOT always correct and can be reason for such a message. Keep in mind that you're constructing Dropbox path, not path to some local file (in your OS)! Make sure you're using POSIX path join or construct it as a string (slash separator, not backslash or something else - the same rule as for your folder path). Even more, to avoid any error and use correct path formatting, better use the path in metadata (in listing result - not the name) instead of constructing yourself (the path there should be ready for use) or use the file ID on link creation.

Other error you may expect  is when a link already exists. You haven't handled such a case in any way. The exception thrown may contain existing link (in such a case you can just grab it) or you may need to take it explicitly with listing direct link (when missing in the exception).

Hope this gives directions.

 

PS: If the application you're working on is "LEGO image for PBI Dashboard" and that folder is not some just existing - left from other application, your path is incorrect definitely. 🙂 In such a case you have to use just "/Image" as path! App folder type applications use the application specific folder as API root and all path are relative to that folder. 😉

View solution in original post

3 Replies 3

Здравко
Legendary | Level 20

Hi @morranjuke,

Such thing could happen for variety of reasons. The information you provided is not enough for limiting them.

To be aware where you're going on, start with empty string as a path when listing the folder and navigate to the right direction. Your path may be correct, but it's not clear where your API is rooted currently (there are variety of options); unexpected rooting may make you correct path become incorrect!

When constructing your file path, you use OS related path join; that's NOT always correct and can be reason for such a message. Keep in mind that you're constructing Dropbox path, not path to some local file (in your OS)! Make sure you're using POSIX path join or construct it as a string (slash separator, not backslash or something else - the same rule as for your folder path). Even more, to avoid any error and use correct path formatting, better use the path in metadata (in listing result - not the name) instead of constructing yourself (the path there should be ready for use) or use the file ID on link creation.

Other error you may expect  is when a link already exists. You haven't handled such a case in any way. The exception thrown may contain existing link (in such a case you can just grab it) or you may need to take it explicitly with listing direct link (when missing in the exception).

Hope this gives directions.

 

PS: If the application you're working on is "LEGO image for PBI Dashboard" and that folder is not some just existing - left from other application, your path is incorrect definitely. 🙂 In such a case you have to use just "/Image" as path! App folder type applications use the application specific folder as API root and all path are relative to that folder. 😉

morranjuke
Explorer | Level 3
Hi @Здравко, thanks for your advice! Let me try your suggestion and come back to you as soon as possible

morranjuke
Explorer | Level 3

Hi @Здравко,

Thanks for your advice! Let me try and come back to you as soon as possible.

Need more support?