Closed affcue25 closed 1 year ago
As par your document this function check if the folder exist then throw the id of that folder other wise create a new folder and throws its id
Where is it written, that this method:
Please have a careful look at the prototype of the method in the docs, then compare with your code, and you'll see why it throws.
I mean, isnt this function works with query as 1st Param, when query fails to find the folder/file, it execute the 2nd param and returns the result? So, in my case, I am making a query to find folder by name, if it doesnt exist or query fails, then in my 2nd param I am creating a folder... but if folder already exist then it should throw me any result or ID of that folder...
await gdrive.files.createIfNotExists(
{
q: new ListQueryBuilder()
.e("name", "TestFolder")
.and()
.e("mimeType", MimeTypes.FOLDER)
.and()
.in("root", "parents")
},
await (gdrive.files.newMetadataOnlyUploader().setRequestBody({
name: 'TestFolder',
mimeType: MimeTypes.FOLDER,
parents: ['root'],
}).execute()
Hi, Did you sort it out, or some assistance is still needed?
Hi, I hope you are doing great. I have been trying to create/read my files in a specific folder, and for that I am using createIfNotExists(...) function. As par your document this function check if the folder exist then throw the id of that folder other wise create a new folder and throws its id.. But I am doing the same code as you have given, but its throwing me exception EISDIR: illegal operation on a directory, read
Heres my code: