2

I have created a public folder using aaa@gmail.com account. The shared folder is visible to anyone even without signing in, and has edit permissions to all ("Anyone on the Internet can find and access. No sign-in required." and anyone "Can organize, add, & edit")

I am using Drive API for Android to upload files to this folder.

OutputStream outputStream = driveContents.getOutputStream();
Writer writer = new OutputStreamWriter(outputStream);
writer.write("<Stuff...>");
writer.close();

MetadataChangeSet changeSet = new MetadataChangeSet.Builder()
                                .setTitle(fileName)
                                .setMimeType(mimeType)
                                .setStarred(true).build();

DriveId id = DriveId.decodeFromString("<SharedFolderID>");
Drive.DriveApi.getFolder(driveApiClient, id)
  .createFile(driveApiClient, changeSet, driveContents)
  .setResultCallback(fileCallback);

When I use aaa@gmail.com to upload the files, it succeeds. But when I share the app with my friend and he tries to upload using bbb@gmail.com, there is an error and he cannot upload files. He gets "Invalid parent folder" error.

Do I need to change something in my code / google api portal / anywhere else so that I am able to upload files to the publicly shared folder using any account?

Thanks a lot in advance!

  • From this [SO question](http://stackoverflow.com/questions/27592521), one workaround to avoid this error "Invalid parent folder", is to use a **ResourceId** in the [Google Drive REST API](https://developers.google.com/drive/v3/web/about-sdk). For more information, check these [Github issue](https://github.com/googledrive/android-demos/issues/35) and related [SO question](http://stackoverflow.com/questions/33248420). – KENdi Mar 22 '17 at 06:23

0 Answers0