2

Trying to check folder exists in 'appdata' folder before creating one. Hence I do get file.list with following code:

GTLQueryDrive *folderExistsQuery = [GTLQueryDrive queryForFilesList];
folderExistsQuery.q =  [NSString stringWithFormat:@"mimeType='application/vnd.google-apps.folder' and trashed=false  and 'appdata' in parents and title='%@'",folderName];

The result is an error.Strange thing When I remove either 'appdata' in parents or title='%@' options in the query I don't get any error. Someone could you please explain whats going wrong here?

Any modification to solution are also welcome.

Edit
Printing description of error:

Error Domain=com.google.GTLJSONRPCErrorDomain Code=500 "The operation couldn’t be completed. (Internal Error)" UserInfo=0x1030d5c00 {error=Internal Error, NSLocalizedFailureReason=(Internal Error), GTLStructuredError=GTLErrorObject 0x10308d890: {message:"Internal Error" data:[1] code:500}}
Raviprakash
  • 2,410
  • 6
  • 34
  • 56

2 Answers2

1

There is a problem with queries that contain title and parents on drive.appdata and drive.file scope. You can either add drive.readonly.metadata temporarily if we're not breaking your installed apps. The fix has been pushed back, but I'm trying to make sure we're fixing it as soon as possible.

Another similar issue: Error when listing files with query

Community
  • 1
  • 1
Burcu Dogan
  • 9,153
  • 4
  • 34
  • 34
  • Luckily My App is not yet out. Hoping that you guys fix it soon. – Raviprakash Jul 11 '13 at 05:00
  • I had encountered similar error during appdata file updating (Not file searching) - http://stackoverflow.com/questions/23707388/unable-update-file-store-in-appdata-scope-500-internal-server-error Do you think the issues is closely related? Thanks. – Cheok Yan Cheng May 17 '14 at 04:13
0

In current version of API to get list of files in application folder spaces property is used:

GTLQueryDrive * query = [GTLQueryDrive queryForFilesList];
query.q = @"mimeType = 'application/vnd.google-apps.folder' and trashed = false";
query.spaces = @"appDataFolder";
kisileno
  • 787
  • 9
  • 23