Need to see if your shared folder is taking up space on your dropbox 👨💻? Find out how to check here.
Forum Discussion
ER2480
5 years agoExplorer | Level 4
NetworkError when attempting to fetch resource when trying to share file using javascript sdk
Hi,
I am very new to the Dropbox SDK, I am trying to programmatically create a link for sharing a file and getting the above error:
NetworkError when attempting to fetch resource when trying to s...
- 5 years ago
Thanks! It looks like the issue here is that when you click "Share File", that causes the page itself to reload (since you're submitting a form), which interrupts the Dropbox API call.
You should update or restructure your page to avoid that reload. That's not really related to the Dropbox API itself, but it looks like this StackOverflow post may be relevant.
Greg-DB
Dropbox Community Moderator
5 years agoThanks! That's helpful. From this output, I see you are getting an API error (with a 409 status code).
You can print out the API error object like to see the endpoint-specific error:
.catch(function(error) {
console.log(error.error);
});
ER2480
5 years agoExplorer | Level 4
Thank you so much for the suggestion. I tried it but it returns .."undefined".
Am I using the correct sdk version?
- Greg-DB5 years ago
Dropbox Community Moderator
From your script tag, you're using the latest version, which should work. (Though for reference, in a production app we recommend you import a specific version, since the SDK may occasionally receive major updates with breaking changes.)
I can't seem to reproduce the "undefined" issue you're seeing though. Would you be able to share a live sample page showing the issue?
- ER24805 years agoExplorer | Level 4
Yes, here is a temporary file on a beta site
https://cdfbeta.creativedecisions.net/_admin/testDropbox.php?
- Greg-DB5 years ago
Dropbox Community Moderator
Thanks! It looks like the issue here is that when you click "Share File", that causes the page itself to reload (since you're submitting a form), which interrupts the Dropbox API call.
You should update or restructure your page to avoid that reload. That's not really related to the Dropbox API itself, but it looks like this StackOverflow post may be relevant.
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!