0

I am new here and newbie in Google Drive thing. I managed to follow and install Google Drive v3. Now, I am stuck as to how can I make a simple PHP code that will upload a text file to my Google Drive. I need a simple PHP code / guide on how to upload a small text file. Please help.

Thanks in advance.

Laminin
  • 1
  • 2

2 Answers2

0

If you want to know how to upload file, then you can check the DRIVE API documentaion for that.

Here you can find 3 options on how to upload file.

Just visit the above link to know more about them.

For the PHP code that you want, then you can check the answer in this SO question. Just remember that you need to set <YOUR_REGISTERED_REDIRECT_URI> to the document to authenticate it.

For more information or other way to upload file using service account, check this SO question.

Community
  • 1
  • 1
KENdi
  • 7,576
  • 2
  • 16
  • 31
0

If you want to understand the process of file upload on google drive. There is a repository on GitHub on how to authenticate and upload files on google drive using Google Drive API in PHP. You can give it a try. https://github.com/SM4991/php-google-drive

Anonymus
  • 11
  • 3