Need to see if your shared folder is taking up space on your dropbox 👨💻? Find out how to check here.
Forum Discussion
alicera
4 years agoExplorer | Level 3
check download file
If I get a link for dropbox and I use the 'wget' to download it.
How to check it if download successfully?
- 4 years ago
alicera In addition to the method Здравко helpfully provided, you could use the /2/sharing/get_shared_link_metadata Dropbox API endpoint to retrieve the metadata for a shared link, or an error if the shared link is invalid.
alicera
4 years agoExplorer | Level 3
https://unix.stackexchange.com/questions/474805/verify-if-a-url-exists
I use the method and give error dropbox link,
it is return link exist
Здравко
4 years agoLegendary | Level 20
Ahh... alicera, now I see what you mean.
You want to check not for error in transfer process or error because of existing (already) file, but link validity.
It's not so trivial cosa Dropbox links are dynamically generated and even when no real file exists link point to error message (as a content, it's still valid). That's why you are getting "200 OK" for both valid and invalid link (the error message is valid 🤫). But there is a workaround. 😉 When some link is invalid, error message gets back immediately. If your link points to real file, redirect is performed to the pointed file. You can exploit this. 'wget' perform redirects by default and that's why always succeeds. If you disable redirects, a "strange" situation will happen: valid links will result in error (can't redirect), but invalid will succeed (redirect doesn't needed). So, inverting the check logic is going let you distinguish valid to invalid links. 🙂 Use something like following template:
wget --method=HEAD -q --max-redirect 0 <some Dropbox shared link>
echo $?The above just print resulting code (currently 0 for invalid link - inverted logic). You can check it in conditional expression too, of course.
Hope this helps.
About Discuss Dropbox Developer & API
Make connections with 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!