RobinBobin / react-native-google-drive-api-wrapper

This wrapper facilitates the use of the Google Drive API in React Native projects.
110 stars 43 forks source link

Google Drive Parent Update #35

Closed MehdiRaza1998 closed 3 years ago

MehdiRaza1998 commented 4 years ago

It has been almost 4 months that my code was working completely fine. But now, suddenly I am not able to upload file on any folder in Google drive via React Native app. I don't think that this is an issue of exceeding limits or something, because I am able to upload file on root folder, but not to any folder/subfolder.

Error is:

403 Increasing the number of Parents is not allowed Google Drive API React Native

Log:

{"error":{"errors":[{"domain":"global","reason":"cannotAddParent",
"message":"Increasing the number of parents is not allowed"}],
"code":403,"message":"Increasing the number of parents is not allowed"}}

When I posted this on StackOverflow, I got to know that Google drive API is updated. So how am I suppose to add a file in the subfolder please help? https://stackoverflow.com/questions/64482189/403-increasing-the-number-of-parents-is-not-allowed-google-drive-api-react-nativ

RobinBobin commented 4 years ago

Maybe #34 will help? Namely,

await GDrive.files.createFileMultipart(
    uploadPayload,
    "application/json",
    { parents: [folderId], name: BACKUP_FILE_NAME },
    false,
  );

That is, specifying only one parent, if you're specifying several now. Can you post your relevant code?

MehdiRaza1998 commented 4 years ago

Wow, this solved the problem for me. I really appreciate the work you have done! Thanks a lot!

RobinBobin commented 4 years ago

Great! I'm very glad you find it useful, thanks.