javascript - OneDrive Saver Api (Multiple Files Upload) -


 var myfiles = [];   if (val == "address") {                         myfiles.push({ 'file': 'http://----/content/file/addresses.xlsx', 'filename': 'addresses.xlsx' });                     }                     if (val == "debitdetail") {                         myfiles.push({ 'file': 'http://----/content/file/debitdetails.xlsx', 'filename': 'debitdetails.xlsx' });                     }                     if (val == "addressassociated") {                         myfiles.push({ 'file': 'http://----/content/file/addressassociatedcompanies.xlsx', 'filename': 'addressassociatedcompanies.xlsx' });                     }                     if (val == "debitdetailassociated") {                         myfiles.push({ 'file': 'http://----/content/file/debitdetailsassociatedcompanies.xlsx', 'filename': 'debitdetailsassociatedcompanies.xlsx' });                     }      var saveroptions = {             file: myfiles,             success: function () {                 // upload complete             },             progress: function (p) {                 // upload progressing             },             cancel: function () {                 // upload cancelled             },             error: function (e) {                 // error occured             }         };          onedrive.save(saveroptions); 

i have used above code dropbox , works because takes array of objects cant find solution onedrive.com! below documentation shows how upload single file using url. want upload multiple files.

the format onedrive site

var saveroptions = {   file: "inputfile",   filename: 'file.txt',   success: function(){     // upload complete   },   progress: function(p) {     // upload progressing   },   cancel: function(){     // upload cancelled   },   error: function(e) {     // error occured   } } 

https://dev.onedrive.com/sdk/javascript-picker-saver.htm

currently onedrive saver lets upload 1 file @ time. depending on type of app you're writing, may option go directly onedrive api. here's info uploading files api.


Comments

Popular posts from this blog

Fail to load namespace Spring Security http://www.springframework.org/security/tags -

sql - MySQL query optimization using coalesce -

unity3d - Unity local avoidance in user created world -