文档AI不支持的输入文件格式

问题描述

自从上次使用文档AI nodeJS API更新以来,我再也无法以jpeg文件格式发送。我首先收到以下消息:

Error: 3 INVALID_ARGUMENT: At this time,the only MIME types supported are 'application/pdf','application/json','image/gif' and 'image/tiff'.

当我更改代码以处理TIFF图像时,收到以下消息:

"(node:15782) UnhandledPromiseRejectionWarning: Error: 3 INVALID_ARGUMENT: Unsupported input file format."

我确定文件是TIFF,首先将其存储在云存储中,并将内容类型描述为“图像/ tiff”

我附上了一些图片以供澄清。

enter image description here

enter image description here

解决方法

我曾经遇到过与您相似的PDF文件问题。 我将pdf文件上传到Google云端存储,并打算使用这些文件运行文档AI NodeJS API,但我遇到了与您相同的错误。 “(节点:15782)UnhandledPromiseRejectionWarning:错误:3 INVALID_ARGUMENT:不支持的输入文件格式。 在我的代码中,将mimeType设置为“ application / pdf”。 但是,将mimeType设置为“ PDF”后,该问题已解决。 我想知道这是否对您有帮助。

相关问答

错误1:Request method ‘DELETE‘ not supported 错误还原:...
错误1:启动docker镜像时报错:Error response from daemon:...
错误1:private field ‘xxx‘ is never assigned 按Alt...
报错如下,通过源不能下载,最后警告pip需升级版本 Requirem...