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.
Asked
Active
Viewed 2,092 times
9

gautamlakum
- 11,815
- 23
- 67
- 90
-
1from this question you may get something helpful http://stackoverflow.com/questions/18002293/uploading-image-from-android-to-gcs – Gopal Sep 08 '16 at 09:34
-
Hi @gopal_patil actually images will be uploaded from the back-end as well. So need some solution from PHP to GCS. – gautamlakum Sep 12 '16 at 09:09
-
have you tried with [Google APIs Client Library for PHP](https://cloud.google.com/storage/docs/json_api/v1/json-api-php-samples). just a reference not actually implemented this. – Gopal Sep 12 '16 at 12:44
-
@gopal_patil I had that links but there is not working code samples or examples available. Whereas Amazon cloud services have many good working code samples available. – gautamlakum Sep 13 '16 at 18:07
1 Answers
7
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

Serge Hendrickx
- 1,416
- 9
- 15
-
1I know, but I am looking for a complete working code sample or example. I am not finding proper guidelines on how to make it working properly. If you can create a code sample or find one for me, I would really appreciate. – gautamlakum Sep 13 '16 at 18:16