【问题标题】:Google drive mime types is not correct (Google thinks that is not PDF?);Google 驱动器 mime 类型不正确(Google 认为这不是 PDF?);
【发布时间】:2013-10-08 15:21:40
【问题描述】:

我从谷歌驱动器获取文件(使用 Java) 一切正常!但是,当我看到 pdf 文档 mime 类型时

file.getMimeType()

类似于:application/vnd.google-apps.document 它不是 application/pdf

问题 1:为什么我在 google 驱动器上的 pdf 文件是 mime 类型 application/vnd.google-apps.document

问题 2:

我需要过滤我的文档,以便仅获取 PDF 文档: 但这不起作用! Googel 认为我的 PDF 是“vnd.google-apps.document”!

 String mime ="application/pdf"; //works when I set vnd.google-apps.document
 String query="'"+id+"'" +" in parents and trashed=false and and mimeType="+mime;
 FileList files = service.files().list().setQ(query).execute();

【问题讨论】:

  • 上传 PDF 文件时,是使用 convert=true 还是 convert=false 上传的?

标签: google-drive-api google-docs-api google-api-java-client google-drive-realtime-api


【解决方案1】:

我最近阅读了许多关于 Drive PDF 已可编辑的内容。所以我的猜测是您使用 convert=true 上传了您的 PDF,因此 Drive 已将它们转换为文档。为防止这种情况发生,请确保 convert=false。

【讨论】:

    猜你喜欢
    • 2014-01-18
    • 2012-02-23
    • 2013-04-23
    • 1970-01-01
    • 2016-07-10
    • 1970-01-01
    • 2018-04-11
    • 1970-01-01
    • 2021-04-24
    相关资源
    最近更新 更多