cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements
What’s new: end-to-end encryption, Replay and Dash updates. Find out more about these updates, new features and 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: 

Chooser get file names on upload

Chooser get file names on upload

Russell P.
New member | Level 1

 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 1

Steve M.
Dropbox Staff

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.

Need more support?
Who's talking

Top contributors to this post

  • User avatar
    Steve M. Dropbox Staff
What do Dropbox user levels mean?