0

How can i retrieve all the data from spreadsheet present in google drive of my account, and also how can i upload a file as csv file or excel file on the google drive server.

I am trying to do it using Dr. Edit sample code provided by google. It is possible to do that using DrEdit sample code??

Also it is mentioned in this following link that we should use spreadsheet api, but it comes for mac and not for iOS.

how to work with spreadsheets using Google Drive API on iOS

Please can anyone provide a proper explanation to this !

Thanks a lot in advance !

Edit:

Google Spreadsheet format 'application/vnd.google-apps.spreadsheet' not working for retrieving spreadsheet files !

Community
  • 1
  • 1
Gurvinder
  • 21
  • 5

2 Answers2

2

For uploading csv or xls and converting it to google docs format:

Just set convert property = yes for GTLQueryDrive object

GTLQueryDrive *query = [GTLQueryDrive queryForFilesInsertWithObject:self.driveFile
                                    uploadParameters:uploadParameters];

query.convert = YES;

[self.driveService executeQuery:query completionHandler:nil];
MetalJr
  • 302
  • 4
  • 14
  • -[GTLQueryDrive setConvert:]: unrecognized selector sent to instance. is there any solution for this ? – Tarang Nov 24 '14 at 07:29
  • @Tarang take a look at this [Reference document](https://developers.google.com/drive/ios/reference/ios-client/interface_g_t_l_query_drive#a9497ad51ff501d19ce9a046fe73629a8) use `fileID` to add optional parameters including `convert` – MetalJr Nov 25 '14 at 11:46
0

For Google Docs (Spreadsheet, Presentation, etc) file formats, you cannot get downloadUrl which is the way Dr.Edit accesses file. Instead, in same file metadata resource where you can get downloadUrl, you can get exportLinks, which exports spreadsheet to known file formats such as Microsoft Excel or csv. You can work with those known file format and upload it again to Google Spreadsheet by setting convert=true when uploading file.

JunYoung Gwak
  • 2,967
  • 3
  • 21
  • 35