cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements
Back again with another edition of 'How we use Dropbox', so find out how Emma uses to-do lists to get it all done 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

Re: Chooser get file names on upload

Steve M.
Dropboxer

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.

Poll
We love to learn from the educators who use Dropbox. Whether you teach kids, teens, adults or a combination of all three, we want to know what apps and integrations you use with Dropbox to help with teaching. Which of the ones below is your favorite, or most used tool?
Who's talking

Top contributors to this post

  • User avatar
    Steve M. Dropboxer
What do Dropbox user levels mean?
Need more support?