Am developing ios app including google drive. In google drive when am trying to list files, it displays all folders, subfolders, subfiles in single page itself. These is my code
GTLQueryDrive *query = [GTLQueryDrive queryForFilesList];
[driveService executeQuery:query completionHandler:^(GTLServiceTicket *ticket,
GTLDriveFileList *filesList,
NSError *error) {
if (error == nil) {
[FilesFromGoogleDrive addObjectsFromArray:filesList.items
];
};
I dont want to list all files in main page. I need similar to google drive application for accessing folders, subfolders, subfiles in sequential way.Am trying this from past one week but there is no good result. So please help me how to access folders, subfolders.
Goto the same Google Sheets File and refresh the page. Then you will get the "List Files/Folders" menu, click on it, and select the "List All Files and Folders" item.
Create a folder, or folders, in your Google Drive that you want to move your C drive documents into. Now, it's as simple as click and drag the documents you want to transfer from your computer to your Google Drive and drop them in.
At drive.google.com, click on Storage, near the bottom of the left-hand sidebar (or click here to visit directly). From the Storage page, you can see a list of your files sorted by size, largest first. Delete any unnecessary files and remove them from the Trash in order to lower your used space.
If you want to list all files in a folder identified by folderId
, you can use the following code (from https://developers.google.com/drive/v2/reference/children/list):
+ (void)printFilesInFolderWithService:(GTLServiceDrive *)service
folderId:(NSString *)folderId {
// The service can be set to automatically fetch all pages of the result. More
// information can be found on https://code.google.com/p/google-api-objectivec-client/wiki/Introduction#Result_Pages.
service.shouldFetchNextPages = YES;
GTLQueryDrive *query =
[GTLQueryDrive queryForChildrenListWithFolderId:folderId];
// queryTicket can be used to track the status of the request.
GTLServiceTicket *queryTicket =
[service executeQuery:query
completionHandler:^(GTLServiceTicket *ticket,
GTLDriveChildList *children, NSError *error) {
if (error == nil) {
for (GTLDriveChildReference *child in children) {
NSLog(@"File Id: %@", child.identifier);
}
} else {
NSLog(@"An error occurred: %@", error);
}
}];
}
Another option is to search for files having folderId
in their Parents collection:
https://developers.google.com/drive/search-parameters
For instance, you can have a search query like the following:
'1234567' in parents
Where '1234567' is the id of the folder you want to list files for.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With