我试图使用将docx文件导出到压缩的html中(另存为压缩的html是Google的特性之一)。但根据文档,支持的导出mime类型是。https://developers.google.com/drive/manage-downloads
text/html
文本/纯文本
申请/rtf
应用程序/vnd.oasis.opendocument.text
申请/pdf
application/vnd.openxmlformats-officedocument.wordprocessingml.document
上传代码
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_url = result.data.to_hash['exportLinks']['text/html']
html = client.execute(:uri => download_url) 有人能告诉我如何将google导出到压缩的html吗?
发布于 2018-02-16 19:34:27
我也有同样的问题。
显然,使用驱动器-API将文档导出到mimeType="text/html“,与单击同一文档的”“”File>Download-> Web (.html,压缩)“菜单项不同。
我想知道谷歌的人是否能对这种不对称现象做出一些解释。
https://stackoverflow.com/questions/17930075
复制相似问题