HTTP Method: POST

Request URI: https://www.googleapis.com/upload/drive/v2/files

Here is the request info generated by the Playground:

POST /upload/drive/v2/files HTTP/1.1
Host: www.googleapis.com
Uploadmypic: image/jpeg
Content-length: 92818
Content-type: image/jpeg
Authorization: Bearer ya29.1.LongKeyHereThatIveReplaceWithThis

A .jpg file was read from my hard drive, then saved to my Google Drive. The file saved to my Google Drive had no name. Name=Untitled

How do I create a file with a name, rather than 'untitled'?

有帮助吗?

解决方案

You need to provide a File resource as the body of the POST request. The File resource contains a title property which is the file name. If you try https://developers.google.com/drive/v2/reference/files/insert#try-it you will see the precise format.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top