Request body for Google drive image upload api - google-drive-api

I have Base64 string of image now i want to upload this to drive using google drive REST api. But i am not sure about the format of request body. Could you please any one help we on this?
Not able to find any example of such.
i want to upload image in Base64 string to drive using google drive rest api, not with any packages or sdk.

For starters change the body to Raw json not raw text.
Then just try adding something like this
{
"name": "myimage.jpg",
"mimeType": "image/jpb"
}
That should get you the metadata. Give me a minute while i See if i can find an example of how to add the actual file data.
You should be able to add that in the form data section form data

Related

Google Drive Service Account change filename usin API Request

I'm trying to perform next API call using PATCH method on a file that is not in a root directory,
API Call for changing the file name (Picture)
The Response (Picture)
The response of above API Call is a File resource with 200 status code, but the file name doesn't changed ;(
I have tried using API v2 and API v3, unfortunately the response is the same. File Name is not changed. For v3 i have used request body {"name": "New Name"}.
Some help please ?
I'm not interested to use any library for perform this call. I'm interested in raw API Call.
Another API Calls for manipulating with files/folders works like expected. Only this call is not working for me.
Sorry for my English,
Thanks in advance.

Append to document with Drive SDK

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.

Get google drive file download URL

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.

Enable my node.js web app to save google map pictures

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.

Google Drive API, page size of the document

I have been working on Google Drive API. Is there a way to get page size of the documents?(PDF, MS Docs)
The google drive api is a file store api. Its basically a directory api. It stores the files in folders and can give you information about the files itself.
"name": string,
"mimeType": string,
"description": string,
It will allow you to upload and download files to this directory. It does not give you more information beyond that.
You cant read the contents of the file or the settings of the file in anyway with this api.