简体   繁体   中英

Google App Engine PHP SDK - Google Cloud Storage - accessing contents of uploaded file

i have a form on a page using CloudStorageTools::createUploadUrl for the action...

i set up my bucket to receive the file, and that works fine... i see the $_FILE populated, and the [tmp_name] is set to a "gs://bucket/key" URL... i can use move_uploaded_file to copy the file with a different name, so my app definitely has access to the bucket and can make changes...

when i use file_get_contents on the same filepath, i get nothing... fopen returns false.

i tried to get the public URL to the file and then requesting it with an HTTPS stream, but that returned

<?xml version='1.0' encoding='UTF-8'?><Error><Code>AccessDenied</Code><Message>Access denied.</Message></Error>

i tried adding all the google api OAuth tokens and API version, but it still returned AccessDenied.

is something wrong on GAE? how can i retrieve an uploaded file's contents?

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM