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.
Related
I just need a starting place. How would you grab files from Google Drive with PHP? So, you would result in this:
<audio src='Google Drive File'></audio>
I'm just starting programming. Any help would be appreciated...
Are you manually sharing just a few specific files or do you want to fetch the file's link dynamically/using lookups, etc.?
For the first, you can use the Google Drive Direct Link Generator.
The other option is to modify the URL yourself so that something with a shared link like https://drive.google.com/file/d/FILE_ID/edit?usp=sharing becomes https://drive.google.com/uc?export=download&id=FILE_ID.
If purely non-manual and only in PHP, use the Drive SDK for PHP (beta) or via the REST API, has PHP examples.
I am hoping to programatically open a drive file with a particular app using the Google drive APIs.
The aim is to mimic the GUI drive method of launching an app using the "Open With" context menu for a selected file.
While I can get a list of the available apps using apps list method, the app resource doesn't detail the Open URL as far as I can work out.
Does anyone know if it is possible to obtain the Open URL using the APIs?
I believe if you have the scope set for drive.apps.readonly you should be able to use the File method getOpenWithLinks to discover the URLs. Just testing it now, the getOpenWithLinks method isn't available on the File class. I wonder if it has been deprecated? Certainly I can't find evidence of it being so.
https://developers.google.com/resources/api-libraries/documentation/drive/v2/java/latest/com/google/api/services/drive/model/File.html#getOpenWithLinks()
Revision: the getOpenWithLinks methods are available again in revision 75 of the v2 drive API.
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
I have little question. Is there any way (I read API, but maybe...) how to list files in folder using only Google Drive API? I mean without scopes Documents List API.
If I send request GET https://www.googleapis.com/drive/v2/files then I get all files and folders in my Google Drive, but I want to show only files which is inside specific folder.
My english is bad, but I hope you understand me.
If not any way to do this, then I must use Documents List API.
Thanks for answers
PS: I make app in C++/QT for MeeGo and Symbian OS mobile systems
Solved. I must use Search string parameters with =q
I have a node.js web application which makes use of google maps. I want to enable a user to save the map they are viewing in a pdf document. I'll use pdfKit to generate the pdf document as it has support for images but for this, I'll first need to save the image of the map. I don't know how I'll go about this. Can anyone give me some ideas on how to do this - how do I save an image of the map a user is looking at on the server?
I believe you would have to get the image file through Google Static Maps API, generate PDF and return the document to the user.
I would also take #Dr.Molle's comment into consideration if you plan to actually store the images in a database.