I am trying to export a docx file to zipped html using Google Drive API (Save as zipped html is one of the feature of google docs). But as per the documentation, supported export mime types are. https://developers.google.com/drive/manage-downloads
text/html
text/plain
application/rtf
application/vnd.oasis.opendocument.text
application/pdf
application/vnd.openxmlformats-officedocument.wordprocessingml.document
UPLOAD code
file = drive.files.insert.request_schema.new({
'title' => 'My document',
'description' => 'A test document',
'mimeType' => 'application/vnd.openxmlformats-officedocument.wordprocessingml.document'
}
)
media = Google::APIClient::UploadIO.new('gdoc.docx', 'application/msword')
result = client.execute(
:api_method => drive.files.insert,
:body_object => file,
:media => media,
:parameters => {
'uploadType' => 'multipart',
'convert' => 'true'
}
)
DOWNLOAD code
download_url = result.data.to_hash['exportLinks']['text/html']
html = client.execute(:uri => download_url)
Can anyone please tell me how can I export google doc to zipped html ?
exportLinks
field like the documentation says. When I wrote this for python, I sometimes have the problem of missingexportLinks
. In python I wait for 30 seconds and do afiles.get
for updated metadata. In ruby, it never shows up when I use the above code. – Sethishtrue
It might fix your version of this problem. Are you getting anexportLinks
key? – Sethish