Need to see if your shared folder is taking up space on your dropbox 👨‍💻? Find out how to check here.

Forum Discussion

Russell P.'s avatar
Russell P.
New member | Level 1
11 years ago

Chooser get file names on upload

 Hat to say it but for me the DropBox API docs are not very clear at all (OK that also goes for other API's as well e.g. MrG's Drive) but hey ho .  My need is actually simple - well it should be but based on the examples - ummm they don't work ....

I am using 'Chooser' because it's nice and simple for my 'users' but can I get any 'responce' back - no.  I'm not worried about too much, just getting the file name and path when a file is uploaded - simple.

So why when I do something like this - direct from the docs -doesn't it work - am I missing something?

var button = Dropbox.createChooseButton(options);
document.getElementById("container").appendChild(button);
var options = {success: function(files) {
 alert("Here's the file link: " + files[0].link)
}
}

I don't get the alert?

 

 

1 Reply

Replies have been turned off for this discussion
  • Do you see any error in the JavaScript console?

    If this is exactly your code, it looks like you're using the options variable before you actually assign it a value. I would expect you to see an error in the browser console.

    Try putting the "var options = ..." line above the call to Dropbox.createChooseButton.

About Dropbox API Support & Feedback

Node avatar for 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!