Using the list
endpoint of the Google Drive api, I can retrieve the file ID and the mimetype of a Google Site file.
I tried to download the file and it fails. The response I get is "Only files with binary content can be downloaded. Use Export with Google Docs files." Makes sense.
Following the documentation here, I tired to export the file and it also fails. The response I get is:
com.google.api.client.http.HttpResponseException: 400 Bad Request
{
"error": {
"errors": [
{
"domain": "global",
"reason": "badRequest",
"message": "The requested conversion is not supported.",
"locationType": "parameter",
"location": "convertTo"
}
],
"code": 400,
"message": "The requested conversion is not supported."
}
}
I tried it with the mimetype "application/pdf" and "application/zip" and "text/html" and still got the same response. What are the my export options here? I cannot find any documentation on this.
I'm having a similar problem with Google Form and Google Script files as well.
My Java code example:
Export export = driveService.files().export(fileId, "application/pdf");
export.executeMediaAndDownloadTo(outputStream);
application/pdf
,application/zip
,text/html
andapplication/vnd.openxmlformats-officedocument.wordprocessingml.document
. Could you please provide more of your Java code so I can have a deeper look at your request? – Rafa Guillermofiles/get
endpoint lists the mimetypes that are available for export, and I can use those mimetypes directly with thefiles/export
endpoint. You can answer my question and I will accept it. – Alistair Jonesapplication/zip
MIME Type to export a Google Form this way. Also where are you finding the list of mimetypes available for export? The supported MIME Types listed here developers.google.com/drive/api/v3/mime-types are not supported for export. – Rafa Guillermo