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 } }
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
Post a Comment