Closed OzymandiasTheGreat closed 5 years ago
It looks like Google Docs does not save the real document file on a Google Drive. I solved this problem by adding a script to export the document file and save it to Google Drive via Google Apps Script. After that, a real file with a size other than 0 appears on the disk and it can be downloaded through the External storage support for Google Drive.
@Ngri88 I am interested by your script ^^
I have encountered the same or a very similar problem.
Sabre\DAV\Exception\ServiceUnavailable Could not open file
This XML file does not appear to have any style information associated with it. The document tree is shown below.
<d:error xmlns:d="DAV:" xmlns:s="http://sabredav.org/ns">
<s:exception>Sabre\DAV\Exception\ServiceUnavailable</s:exception>
<s:message>Could not open file</s:message>
</d:error>
<d:error xmlns:d="DAV:" xmlns:s="http://sabredav.org/ns">...</d:error>
I wanted to add (in case it was not clear from the issue header) that other file types work as expected (e.g., PDF files).
@Ngri88 I am interested by your script ^^
You are welcome. I am not the author of this script, however, it works flawlessly.
function downloadXLSX() { var ssID = SpreadsheetApp.getActive().getId(); var URL = 'https://docs.google.com/spreadsheets/d/'+ssID+'/export?format=xlsx'; var blob; var response = ""; var token = ScriptApp.getOAuthToken(); // REPLACE xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx with your Gdrive folder's ID var destination = DriveApp.getFolderById("xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");
response = UrlFetchApp.fetch(URL, { headers: { 'Authorization': 'Bearer ' + token } });
blob = response.getBlob().setName('Spreadsheet_name.xlsx');// Convert the response to a blob
var file = DriveApp.createFile(blob); // Create a file with the blob and place it to Drive's folder
destination.addFile(file);
}
It is fixed, I did a stupid mistake ;)
Nextcloud version: 13.0.5 files_external_gdrive: 0.28
Cannot download Google docs through web interface, while they do show up as size 0 odt documents, clicking on them takes a very long time and eventually errors out.
This also prevents syncing Google Drive folder with the desktop client: as soon as Google doc is encountered sync is aborted. If you need additional info, do let me know.