It seems that with the new version of the Google spreadsheet, it is no longer possible to download the entire Google spreadsheet using JS. So far I have used this method (which still works great for files that were created earlier):
var xhr = new XMLHttpRequest();
xhr.open('GET', 'https://docs.google.com/feeds/download/spreadsheets/Export?key=' + id + '&exportFormat=xlsx');
xhr.responseType = 'arraybuffer';
xhr.setRequestHeader('Authorization', 'Bearer ' + gapi.auth.getToken().access_token);
xhr.onload = function() {
...
};
xhr.send();
I found a new download URL :
https://docs.google.com/spreadsheets/d/_ID_/export?format=xlsx&id=_ID_
But, unfortunately, there is no title Access-Control-Allow-Origin, so the link cannot be accessed using JS. Is there any other way to upload a file?
The Google Drive API displays the export URL:
https://docs.google.com/spreadsheets/export?id=_ID_&exportFormat=xlsx
But also there is no title Access-Control-Allow-Origin.
Is there any other way to download this file using only JS?
Nazin source
share