I have an app that lets users upload an image, and I want other users to be able to see that image.
I am using the CloudStorageTools::createUploadUrl method to allows users to upload via POST. I am then taking the uploaded file and using move_uploaded_file to store it on Google Cloud Storage.
Then, I am using CloudStorageTools::getPublicUrl to get the URL for the file. It returns the correct URL, but the file is not publicly accessible so I get a XML error response "AccessDenied".
I know this is because the file isn't shared publicly, but I'm not sure how to make it public after it gets upload.
I tried passing in a "acl=public-read" option to createUploadUrl, but it returned an error of unknown option.
I see an example of how todo this on this page: https://developers.google.com/appengine/docs/php/googlestorage/public_access however, my workflow requires me to allow normal POST uploads using the createUploadUrl method as shown here: https://developers.google.com/appengine/docs/php/googlestorage/user_upload
How do I make user uploaded files automatically publicly accessible?