I want the create a widget where user can select spreadsheet tab. The consent screen asked the user to login/allow to access his drive with offline access (first time prompt only). After login/allow : User's all spreadsheet list an on selection download all the sheets of selected spreadsheet in separate csv files. For this I used drive/sheet api in java-script. But now I only can download the first sheet of selected spreadsheet.
function downloadGDriveFile (file) {
var request1 = gapi.client.drive.files.export({
'fileId': '137QkATyycYn-qwy9z0OGx70EsbmwFGcxarCxq45vfAo',
'mimeType': 'text/csv'
//'mimeType': 'application/vnd.oasis.opendocument.spreadsheet'
})
request1.then(function(response) {
console.log(response);
alert(response.body);
$.ajax({
type: "POST",
url: 'http://devhub.escalon.services/scripts/ravin/last/interfacefile.php',
data: {data : response.body},
success: function(response) {
}
});
}, function(err) {
console.log('Error');
console.log(err.result.error);
});
}
Is it possible to download all sheets as csv. Or I have to use any other way to accomplish this task. I tried many codes but didn't find any solution. Help me with a solution/code. Or tell any other way to accomplish my task