grep
grep

Reputation: 5623

Google drive mime types is not correct (Google thinks that is not PDF?);

I get files from google drive(Using Java) Everything works! BUT, when I see pdf documents mime type

file.getMimeType()

it is something like that: application/vnd.google-apps.document it is not application/pdf

Question 1: Why is my pdfs at google drive with mime type application/vnd.google-apps.document

Question 2:

I need to filter my document, in order to get only PDF documents: but this does not works! Googel thinks that my PDF is "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();

Upvotes: 1

Views: 600

Answers (1)

pinoyyid
pinoyyid

Reputation: 22296

I've been reading a number of comments recently that Drive PDFs have become editable. So my guess is that you uploaded your PDFs with convert=true, and so Drive has converted them to docs. To prevent this, make sure that convert=false.

Upvotes: 1

Related Questions