I need to get some file id's from Google Drive every day searching by filename, but Drive.Files.list() isn't working as expected.
API works fine for some files, but some ones returning null (both files are in same folder level). If i modify the query to search by "contains" instead of "=", it returns the file i expect, but if i search by exact name, it returns null.
I tested directly in Google Drive search bar and the behaviour is the same.
title:filename.jpg returns nothing, but filename.jpg exists.
I did a lot of research, but can figure out what's happening. Anyone seeing something i didn't noticed?
let test = Drive.Files.list({
supportsAllDrives: true,
includeItemsFromAllDrives: true,
corpora: 'drive',
driveId: '0AA82saZDt7ipUk9PVA',
q: "title = 'filename.jpg'",
fields: 'incompleteSearch, items(id,title,mimeType)',
});
return test;
Original filename contains some special chars, but i can find normally other files with special chars also, they're just another file type: i can find .psd files, but not .jpg files with same name.