Need to see if your shared folder is taking up space on your dropbox 👨💻? Find out how to check here.
Forum Discussion
brtdvrs
3 years agoHelpful | Level 5
i want to check is file exists with async/await
I tried this but it doesn't work: async function CheckIfFileExist(dbx, fileName) { let fentries = []; dbx.filesListFolder({ path: "" }) .then(async function (response) { fentries = await respons...
brtdvrs
3 years agoHelpful | Level 5
I just have to look in de root for the file. That’s not the problem. My call comes back undefined and not true or false because the await response does not work.
Greg-DB
Dropbox Community Moderator
3 years agoThanks for clarifying. It sounds like the issue is more around how async/await itself works in JavaScript. I can only really help with the Dropbox API/SDK in particular, so I recommend referring to a guide/documentation for async/await in JavaScript.
That said, it seems like "await response.result.entries" may not be what you want. Perhaps you mean to await the API call itself?
Also, "fentries > 1" doesn't seem to make sense. I suspect you meant "fentries.length >= 1" instead.
About Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.
The Dropbox Community team is active from Monday to Friday. We try to respond to you as soon as we can, usually within 2 hours.
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, Facebook or Instagram.
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!