0

Since the last update with Document AI Node.js API, I'm not able to send in JPEG file formats any more. I received the following message first:

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

When I changed my code to handle TIFF images I got the following message:

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

I'm sure the file is a TIFF, I store it in cloud storage first and the content type is described as "image/tiff"

I attached some images for clarification.

Holt Skinner
  • 1,692
  • 1
  • 8
  • 21
fredsco
  • 313
  • 4
  • 19

2 Answers2

0

I have ever had a similar problem to you with PDF file. I uploaded pdf files to google cloud storage and was going to run document AI NodeJS API with the files, but I got the same error as you. "(node:15782) UnhandledPromiseRejectionWarning: Error: 3 INVALID_ARGUMENT: Unsupported input file format." In my code, the mimeType was set into 'application/pdf'. But the problem was fixed after the mimeType was set into 'PDF'. I wonder if this helps you even a little bit.

ZhaoRachi
  • 49
  • 6
0

The Document AI API has been updated in the time since this post was originally made. I recommend using the v1 REST API and Node.JS Client Libraries

The Supported Files page in the documentation also lists the supported File Types with the appropriate MimeTypes.

double-beep
  • 5,031
  • 17
  • 33
  • 41
Holt Skinner
  • 1,692
  • 1
  • 8
  • 21