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

File uploading in root only, even after setting parent folder id. #94

Closed shivardev closed 9 months ago

shivardev commented 10 months ago

I'm trying to upload a file in a Folder I have given the folderID, yet it is uploading in root directory.

    await gdrive.files
                  .newMultipartUploader()
                  .setData(base64Data, MimeTypes.BINARY)
                  .setIsBase64(true)
                  .setRequestBody({
                    name: pickedDocument.name,
                    parent: ["13p9DHmWleA8nCDCOd15r-qt2wvc_bMZ8"]
                  })
                  .execute();

This part of code is creating a directory inside the desired directory

  await gdrive.files
              .newMetadataOnlyUploader()
              .setRequestBody({
                name: 'Rimmind',
                mimeType: MimeTypes.FOLDER,
                parents: ['13p9DHmWleA8nCDCOd15r-qt2wvc_bMZ8'],
              })
              .execute(),
RobinBobin commented 10 months ago

Hi, Typo in your first sample, have a thorough look, please.