0

I have a folder called "test-my-app1" that includes my app for the google's app engine. This folder has a folder inside called img that stores all of my images for the CSS of my app, and also has a folder named profile. In the folder called profile ( test-my-app1/img/profile/ ) the user can upload a photo for his profile picture.

The php script that I use works successfully for the XAMPP that I have in my laptop. The problem is that when I run the script in app engine, image is not uploaded into my folder "profile". This is my app yaml file:

application: test-my-app1  
version: 1
runtime: php
api_version: 1

handlers:

- url: /img
  static_dir: img

- url: /profile/(.*\.(gif|png|jpg))
  static_files: profile/\1
  upload: profile/(.*\.(gif|png|jpg))  

any idea how to fix it? there is a possible answer here : App Engine PHP upload file for my question but did not solved my problem

Community
  • 1
  • 1
user2491321
  • 673
  • 10
  • 32
  • I might be that user upload needs to use special service from Google App Engine https://cloud.google.com/appengine/docs/php/googlestorage/user_upload – Chris Jan 01 '15 at 18:05

1 Answers1

0

You need to upload files to Google Cloud Storage, the instructions on how to do this are here.

Once the files have been uploaded to Google Cloud Storage you can serve them in HTTP responses, follow the instructions here on using the Image serving service that allows for on the fly resizing, cropping and rotation.

You need to consider the filesystem where your application files are uploaded to as read only.

Stuart Langley
  • 7,044
  • 1
  • 20
  • 20
  • I see what you mean...I couldn't understand a lot of things from the documentation. Is there any tutorial or example to demonstrate us how to do this step by step? – user2491321 Jan 02 '15 at 14:52
  • quite a few tutorials on the interwebs, e.g. http://www.zdatatech.com/blog/php-upload-to-google-cloud-storage-from-app-engine – Stuart Langley Jan 03 '15 at 05:36
  • thank you for your answer, I visited the site and tried the code for me. It is not working, I have post a question here: http://stackoverflow.com/questions/27754507/image-upload-to-google-bucket-ay-cloud-storage of what I have done, if you have some free time please check – user2491321 Jan 03 '15 at 12:25