Need to edit a file using GDrive which is stored in my application

98 Views Asked by At

I have my own application where user uploads a file. Now whenever he want to edit this file, my application will try to open this file using google docs. This is a web-application in java. How to do it?

I didn't see a sample for same in net.

2

There are 2 best solutions below

0
Jescanellas On

Drive equivalent of Dropbox would be "Back up and Sync" which you would need to install in your server, but it's only available for Windows and Mac. Supposing your server is Linux, the only thing I think of is uploading manually the files with a script, and downloading them to the server after the user finishes editing.

For more information, you can check the Drive Quickstart here. Regarding the GDrive online, you can change the default apps using the Drive API too. In conclusion, unless your server runs on Windows, I think it’s a complex thing to do.

0
IT Hit WebDAV On

My development team tried to solve similar problem. However, from what I see it can not be solved, and here is why:

  • To edit document it must be converted to Google format. Even though it is possible to automatically convert document using Google API, the document formatting will break significantly. Constant round-trip conversions and formatting breaks make such solution unusable (at least in our case).
  • Alternatively, you can convert and store documents in your DMS in Google format (Json), so the conversion and formatting does not happen when you edit them. But from what we see there is no way to upload a Json Google Docs document back to Google. Even though there are Google Drive API for uploading documents it either does not support Google Docs Json format or it is simply broken. See this post for more details: Writing a Google Docs document in Google format (Json) does not work