Skip to content

Instantly share code, notes, and snippets.

@Karthik-B-06
Last active April 10, 2019 12:25
Show Gist options
  • Save Karthik-B-06/49537a4a0cfbb03a2a409aca375997ec to your computer and use it in GitHub Desktop.
Save Karthik-B-06/49537a4a0cfbb03a2a409aca375997ec to your computer and use it in GitHub Desktop.
dropboxIconClicked() {
let options = {
success: async files => {
let attachments = [];
for (let i = 0; i < files.length; i++) {
let attachment = {};
attachment._id = files[i].id;
attachment.title = files[i].name;
attachment.size = files[i].bytes;
attachment.iconURL = files[i].icon;
attachment.link = files[i].link;
attachment.extension = `. ${files[i].name.split(".")[1]}`;
attachments.push(attachment);
}
this.tempAttachments = attachments;
console.log(this.tempAttachments);
},
cancel: function() {},
linkType: "preview",
multiselect: true,
extensions: [
".pdf",
".doc",
".docx",
],
folderselect: false,
sizeLimit: 102400000
};
Dropbox.choose(options);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment