Upload File to Google Drive Using PHP
Author : Gopal Joshi
Usage:
Update Composer
$ composer update
Generate Google Secret File from https://console.developers.google.com/ and save it in `secrets` folder.
Include upload.php
<?php
include 'upload.php';
$drive = new GoogleDrive();
$file = $drive->upload('files/', 'photo.gif');
if (!empty($file->id)) {
printf("File Uploaded Successfully! [ID: %s\n", $file->id.']');
}
?>