Search code examples
javascriptdropboxdropbox-api

select multiple file using Dropbox.choose() function?


i am using dropbox.choose() function in my code but i am facing problem in multiple file selection its allow me only one file selection and also it not showing alert message after selection of file.

Let me know if any one have solution for it ? Here is my code :

if i use var option ={ ...........}; then pop-up window open automatically when i refresh the page so i use only option={.........};

Here is DEMO LINK

CODE:

options = {
    success: function(files) {
        alert("Here's the file link:" + files[0].link)
    },
    cancel: function() {
    },
    linkType: "direct",
    multiselect: true,
    extensions: ['.pdf', '.doc', '.docx'],
};
Dropbox.choose(options);

Solution

  • This code looks pretty reasonable, but it should probably be var options = ... (with the "var").

    Make sure you're calling Dropbox.choose from a user action (like a click). Otherwise popup blockers might not allow the popup.

    Perhaps you can try to make a simple web page that shows the problem and share the full HTML and JavaScript. I don't see obvious problems in the code snippet you show.