Skip to content

Latest commit

 

History

History
22 lines (18 loc) · 1.05 KB

File metadata and controls

22 lines (18 loc) · 1.05 KB

GitHub issues GitHub stars GitHub license

File-Uploader-To-Google-Drive-PHP

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.']');
  }
?>