Can anyone help me draw out the code/ steps for uploading an image onto cloud SQL via the App engine? I take the snap from my Android app which calls the PHP app on the APP Engine.
Why would you upload to CloudSQL? You should be uploading to Cloud Storage.
Is this not clear enough?
Related
Can we upload image files to a GCP running compute engine directly using PHP?
I know that it can be done using the backend ssh on GCP.
I have a solution that works in my local system to upload files but does not work on GCP.
Based on initial research it appears that GCP does not allow file upload directly.
Need confirmation though or if there is a way in which file upload can work, please enlighten.
I do not think it can be done directly through php, through ssh yes.
You can upload files with PHP.
If you want to upload to the server local disk, things become a bit simpler. Just ensure you have PHP configured for upload: PHP File Upload
If you want to upload to Google Storage, say to a bucket, you'd need to authenticate and get access there. Google Cloud SDK can provide this. Then you can install API Client Libraries for PHP and optional Cloud SDK components. That way you might call gcloud shell command or use API. Cloud SDK will provide transparent connection and authentication for you so that you can upload to the Google Storage.
Please see:
Cloud SDK
Google API Client Libraries
Can I write (and read) files using PHP in my google cloud storage when Im not using a Google App Engine?
In other words, may I have my website running on another web hosting and use google cloud to store (and read in future) my JSON files only? the JSON files need to be written on runtime and by users.
you can store any files using any programming language like PHP to any cloud storage like google cloud storage or amazon s3, dropbox...etc
Checkout this documentation:
https://github.com/GoogleCloudPlatform/google-cloud-php#google-cloud-storage-ga
I am building an android app where users need to upload & retrieve the images. I need to do that with the Google Cloud Storage. How can I do that if there is a way? I have used PHP as a backend & APIs. I see that they provide APIs for that but there is no way of direct implementation with the PHP. The backend and APIs' code is uploaded on the Google Compute Engine.
You could either upload the image on your frontend and give the url of the image to your BackEnd. Or you could use the GCS JSON API from your php backend to upload the image from there. Here is an example of using the JSON API to upload an image to cloud storage, but in the end it's just a simple POST request which can easily be done in php.
Further info:
https://cloud.google.com/storage/docs/json_api/
https://cloud.google.com/storage/docs/json_api/v1/json-api-php-samples
I'm using Google Cloud Storage for media. My website is stored elsewhere. I want to serve medias for client users (through web browser), but I don't want to use public images (I want "keys"). I think it's possible on app engine (building URL), but my question is:
Is it possible to build URL to Google Cloud Storage stored medias from another server with PHP ? Or is there an API for calling Google Cloud Storage if my site is not on App Engine ?
Hope it's clear enough. Sorry, I did not found answer (I'm a new user).
Yes, the google-api-php-client library can be used outside of AppEngine. There is a PHP Example Tutorial to help you get started.
I want to upload the photo in google cloud server instead of my server to avoid load on my sever. Also I want to fetch the images later in my server. I will do that in php and mysql. Is it possible to do that? If so then how shall I proceed? Please help me.
You can interact with Google Cloud Storage via its RESTful API or use a php library like tws_service_google_storage.