Git Product home page Git Product logo

storage-getting-started-php's Introduction

status: inactive

Google Cloud Storage PHP Sample Application

Description

This is a simple web-based example of calling the Google Cloud Storage API in PHP.

Prerequisites:

Please make sure that all of the following is installed before trying to run the sample application.

Setup Authentication

NOTE: This README assumes that you have enabled access to the Google Cloud Engine API via the Google API Console page.

  1. Visit https://console.developers.google.com to register your application and generate an API key.
  • Click APIs & Auth in the left column, and then click Credentials.
  • Click Create new client ID to create a new client ID.
  • In the Create Client ID window, choose Web application.
  • In the Redirect URIs box, specify the URL for your PHP page, e.g., http://localhost/app.php.
  • Click Create Client ID.
  • In the Public API access section of the Credentials page, click Create new Key.
  • In the Create a new Key window, choose Browser key.
  1. Update app.php with the redirect uri, consumer key, secret, and developer key obtained in step 1.
  • Update YOUR_CLIENT_ID with your oauth2 client id.
  • Update YOUR_CLIENT_SECRET with your oauth2 client secret.
  • Update YOUR_REDIRECT_URI with the fully qualified redirect URI, e.g., http://localhost/app.php.
  • Update YOUR_API_KEY with your API key.
  • Update YOUR_PROJECT_DEFAULT_ID with your project ID, which can be found by visiting https://console.developers.google.com and selecting a project.
  1. Update app.php with remaining default settings. Search and replace all strings starting with 'YOUR_DEFAULT_' with their associated values.

Running the Sample Application

  1. Load app.php on your web server, and visit the appropriate website in your web browser.

More Information

See https://developers.google.com/storage/docs/json_api/v1/json-api-php-samples

storage-getting-started-php's People

Contributors

bshaffer avatar elibixby avatar marcgel avatar ziyadm 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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 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  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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

storage-getting-started-php's Issues

have you tried following the readme file yourselves?

I'm trying to set up a google admob report downloader, and a google play report downloader, but the php clients, readme files are last updated 4 years ago on multiple places and the examples are not working. The pages you are describing do not exist, client / project id are all different (maybe renamed?), nothing matches and is frustrating. If you can't update the readme's could you please just remove the old readme files? It's utterly confusing and not helpful whatsoever.
For example in this readme the instructions are:

Visit https://console.developers.google.com to register your application and generate an API key.

Click APIs & Auth in the left column, and then click Credentials.
ok, even though the sidebar is called APIs & Services.
Click Create new client ID to create a new client ID.
no such thing
In the Create Client ID window, choose Web application.
no such thing
In the Redirect URIs box, specify the URL for your PHP page, e.g., http://localhost/app.php.
Click Create Client ID.
no such thing. I think you get the point.

example of download

Hi, I looked at documentation and don't find any example of download a file, I only get metadata of a object.

Apache2 / php on a Mac -- Documentation suggestions...

For a Mac, you can enable Apache2 using these instructions.

Once that is done, you should can set either the HOME or the GOOGLE_APPLICATION_CREDENTIALS in either .htaccess or /etc/apache2/users/userName.conf
SetEnv GOOGLE_APPLICATION_CREDENTIALS /Users/lesv/Downloads/Abelana-5ca655910529.json

SetEnv HOME /Users/lesv/

I am getting 403 didnt identifty why

Fatal error: Uncaught exception 'Google_ServiceException' with message 'Error calling GET https://www.googleapis.com/storage/v1beta2/b/pubsite_prod_rev_06855146327030654290/acl?key=GOOGZTWSZWYQ3GE4XYQO: (403) Forbidden' in /home/gaditek/public_html/support/testRenew/google-api-php-client/src/io/Google_REST.php:66 Stack trace: #0 /home/gaditek/public_html/support/testRenew/google-api-php-client/src/io/Google_REST.php(36): Google_REST::decodeHttpResponse(Object(Google_HttpRequest)) #1 /home/gaditek/public_html/support/testRenew/google-api-php-client/src/service/Google_ServiceResource.php(186): Google_REST::execute(Object(Google_HttpRequest)) #2 /home/gaditek/public_html/support/testRenew/google-api-php-client/src/contrib/Google_StorageService.php(88): Google_ServiceResource->__call('list', Array) #3 /home/gaditek/public_html/support/testRenew/app.php(125): Google_BucketAccessControlsServiceResource->listBucketAccessControls('pubsite_prod_re...') #4 {main} thrown in /home/gaditek/public_html/support/testRenew/google-api-php-client/src/io/Google_REST.php on line 66

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.