Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/typescript/9.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Google drive api 上载带有Google Drive API的PDF文件-Google Drive Web客户端中没有可用的预览_Google Drive Api - Fatal编程技术网

Google drive api 上载带有Google Drive API的PDF文件-Google Drive Web客户端中没有可用的预览

Google drive api 上载带有Google Drive API的PDF文件-Google Drive Web客户端中没有可用的预览,google-drive-api,Google Drive Api,我们使用GoogleDriveJava客户端API、OAuth2.0和GoogleApps域范围的委托和增量上传 文件,PDF在Google Drive中(上传时没有问题),但Google Drive Web客户端预览PDF不可用(也适用于.doc和.docx文件) 有没有一种方法可以像用户直接上传文件一样使用GoogleDriveAPI?阻止“预览”出现的“错误”配置在哪里?下载文件的工作非常完美(正如我在上传前所说)。抓住了要害,但我注意到您的Mime类型是大写的(APPLICATION/

我们使用GoogleDriveJava客户端API、OAuth2.0和GoogleApps域范围的委托和增量上传

文件,PDF在Google Drive中(上传时没有问题),但Google Drive Web客户端预览PDF不可用(也适用于.doc和.docx文件)


有没有一种方法可以像用户直接上传文件一样使用GoogleDriveAPI?阻止“预览”出现的“错误”配置在哪里?下载文件的工作非常完美(正如我在上传前所说)。

抓住了要害,但我注意到您的Mime类型是大写的(APPLICATION/PDF)。当我在我的驱动器中查看pdf时,mime类型是小写(application/pdf)。

这里必须进行其他操作,因为我得到了完全相同的东西,但我的mimeType已经是小写的。

我在我的web.config中添加了它来解决这个问题。现在每一次都有效

<basicHttpBinding>
    <binding maxBufferPoolSize="2147483647" maxBufferSize="2147483647" maxReceivedMessageSize="2147483647" messageEncoding="Text">
      <readerQuotas maxDepth="2000000" maxStringContentLength="2147483647" maxArrayLength="2147483647" maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647" />
    </binding>
  </basicHttpBinding>

我们已经将Lowcaser函数与MimeType一起使用,现在预览它的工作情况。谢谢你的提示。