Im building an application in nodejs that uploads documents to google drive, how can i convert the document to google docs format before uploading it or while uploading it.
You want to specify convert = true when doing the insert. See https://developers.google.com/drive/v2/reference/files/insert
Related
I have folders of images saved on Google Drive and I need to download only the images ending with the letter Z.
Here are a few examples:
DJI_20210405134404_0037_Z.JPG
DJI_20210405134404_0037_W.JPG
DJI_20210405134346_0036_Z.JPG
DJI_20210405134346_0036_W.JPG
Is there a clever way to do this with an API or other methods?
Here is the example made in Laravel where using google Drive API users can filter the files based on the requirements and download multiple files.
https://github.com/jd-patel/laravel-google-drive
I've been swimming through searches and tutorials and guides and references for days, and I can't seem to find a good way to generate google docs via Java.
I can generate/import .txt files as regular google doc files successfully with java using the drive api, but that's only text files; I need to at least include unordered lists and links in the doc for it to be useful.
My next attempt would be to generate a .rtf or a .doc and then try to import that into google docs, but before I embark on such a project, I wanted to ask you guys first. I also see the realtime api, but it looks like it doesn't specifically deal with docs, just arbitrary data.
What's the recommended way to upload a new google doc with lists and links and stuff?
Thanks!
Probably the simplest import format would be HTML. Just set convert=true and you should be good to go.
There is no stand-alone API for creating or manipulating the contents of Google Docs files. As you've found, you can create documents in other formats and import them with the Drive API.
If you don't need to work in Java, the other option is to use Google Apps Script, which provides a service for creating and manipulating Google Docs files. More information in this guide.
When I have a File in Google Drive that is a native Google Docs document, then I have access to exportLinks for different mime-types, also for PDF;
But I have MSWORD documents that have been generated. The exportLinks property is always null for MSWORD document. In the web interface I can print which downloads a perfectly converted PDF document.
Question: can I generate a PDF from a MSWORD file somehow using the SDK ?
Been up and down through the docs looking for clues.
The download/print link downloads from a real long URI :
https://doc-0o-a0-docsviewer.googleusercontent.com/viewer/securedownload/1ve0rd17der7n5d32lker62ffdq2175h/<randomstring>/<longnumber>/<randomstring>=/<randomstring>/<randomstring>==?docid=<randomstring>&chan=<randomstring>&dom=<googleappsdomain>&sec=<randomstring>&a=gp&filename=<filename>&nonce=<nonce>&user=<userid>&hash=<hasvalue>
anybody ?
Thx
ExportLinks are only provided for documents in Google-native formats, so you'll have to convert the MS Word document to Google Docs before you can export it as pdf (and other supported file formats).
Is it possible to append some arbitrary text to the bottom of a document using the Drive SDK?
Not directly using the API, sorry.
You can do it by downloading the file, appending data, and updating it.
Following the Hello world application and using the File Picker, I am able to get a google drive file information.
I would like to get the download url of this file (it is a binary file) in a my web application.
Is there any way to get it with the new javascript sdk?
Yes.
The Picker returns the id string. Use this to get the item object (https://developers.google.com/drive/v2/reference/files/get) which will contain a variety of download URL's depending on your precise requirement.