Upload files to your google drive via gdrive api.
- Supports offline token so that you don't need human intervention to authenticate each time script is run
- Chunked upload to support large files
To get started:
- Enter credentials in both scripts (get here https://console.developers.google.com/)
- Run gdrive_token.php to authenticate and save token locally to file. This you only need to do once.
- Include gdrive_upload.php in your project and upload files like so:
include_once("gdrive_upload.php"); $fullPath = "/media/myCloud/small.mp4"; // path to file you want to upload $gdrive = new gdrive; $gdrive->fileRequest = $fullPath; $gdrive->initialize();