GithubHelp home page GithubHelp logo

numsu / google-drive-sdk-api-php-insert-file-parent-example Goto Github PK

View Code? Open in Web Editor NEW
25.0 7.0 20.0 812 KB

Small and very simple commented example of a server-side application where you can log in and insert files to Google Drive through their API. Also about creating folders and logging in though google.

License: MIT License

PHP 99.96% CSS 0.04% JavaScript 0.01%

google-drive-sdk-api-php-insert-file-parent-example's Introduction

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.

google-drive-sdk-api-php-insert-file-parent-example's People

Contributors

numsu avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

google-drive-sdk-api-php-insert-file-parent-example's Issues

Compatibility issue with latest Google Drive API

Hi Miro,

I want to use your example with newer version of API, But I found that there are so many changes in the API core schema. So any suggestion, what should I do to make File Uploading with Newer Version of API.

Thank you

Uploading files to Same drive without considering current logged in google account

Hi Miro,
i have used your example it is useful but i have found one issue that is "it uploads files to drive which is used first time". I have elaborated below the issue with scenario.

Step 1 : I have authorized your app for account [email protected] and then upload the file under Test folder.File was uploaded successfully.

Step 2 : Then I Logged out from [email protected] google account.

Step 3 : Then immediately i want to upload another file but this time to different google account , As using your app it ask for authorization and this time i have logged in with [email protected] account and then fill the form and submit it but file is not uploaded in [email protected] drive but uploaded in [email protected] account's drive.

NOTE: And some time it gives "Unexpected error" from functions.php > getCredentials() method >as there is $credentialsArray without $credentialsArray['refresh_token'].

I have tried a lot but could not find any solution.
Thank you.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.