I'm currently porting a webservice I've built to work with Google App Engine. One of the main functions in the webservice is to upload an image (a profile picture, for example). Currently what I do is:
- Authenticate the user who wants to upload the image using his unique API KEY and other data.
- Upload the file, give it a unique name and store the name of the file inside the user's row in the mysql database.
Now in order to port the file upload to App Engine I'm using Google Cloud Storage and following this tutorial: https://cloud.google.com/appengine/docs/php/googlestorage/user_upload
I'm trying to get the file upload to work with my Android app the following way:
- The user makes a request, the webservice authenticates him and sends in response the upload url created by
CloudStorageTools::createUploadUrl. - The user uploads the image to this URL
- Now heres the problem: After the upload is done, a POST is made to the given php file in
createUploadUrl(I quote from google's docs) with the uploaded file. But how can this script know who uploaded the file it got? I can't pass any parameters indicating who uploaded the file to createUploadUrl so I can't insert the file name to a user in the Cloud SQL database, so now theres only a file not associated with anything in Cloud Storage.
Any hints? Am I missing something?
createUploadUrl- Mars