Skip to content

Latest commit

 

History

History
13 lines (11 loc) · 947 Bytes

File metadata and controls

13 lines (11 loc) · 947 Bytes

google-drive-sdk-api-php-insert-file-parent-example

Small and very simple well commented example of a server-side PHP application where you can log in and insert files to Google Drive through their API. Also about creating parent folders and instering the file there.

  1. Go to Google Developers Console (https://console.developers.google.com) and create your own project.
  2. Enable Drive API and SDK for your project
  3. Go to APIs & Auth / Consent screen and name your project, also select an email address
  4. Go to APIs & Auth / Credentials and create a new OAuth 2.0 Client ID.
  5. Set your origins to localhost:yourporthere (or your domain)
  6. Set your Redirect URI to localhost:yourporthere/fileUpload.php (or your domain)
  7. Download the information in a JSON (press the button), and place it like {document root}/conf/googleClientId.json
  8. Comment, star and ask questions! And best of all, learn.