I have a problem. any help is welcome.
I am developing a solution that need to use google apis like cloud storage, Drive, etc.
In the clasic profile page I have to upload picture profile. then I use a angularjs to post data to my appengine/php/yii
formPHP:
`
<?php
require_once 'google/appengine/api/cloud_storage/CloudStorageTools.php';
use google\appengine\api\cloud_storage\CloudStorageTools;
$options = [ 'gs_bucket_name' => 'seektrabajo' ];
$upload_url = CloudStorageTools::createUploadUrl('/perfiles/subirFotoPerfil', $options);
?>
<input type="file" name="file"
nv-file-select="uploader.uploadAll()"
uploader="uploader" />
`
and when submit send data to google and google to yii ajax service:
`
public function actionSubirFotoPerfil(){
$answer = array('answer'=>'Incompleted','serverFile'=>'sinfoto.png');
if(!empty( $_FILES )){
$filename = $_FILES['file']['name'];
$gs_name = $_FILES['file']['tmp_name'];
move_uploaded_file($gs_name, 'gs://seektrabajo/'.$filename);
$answer = array( 'answer' => 'File transfer completed','serverFile' => $filename);
}
echo json_encode( $answer );
Yii::app()->end();
}
`
the problem is that never save the file uploaded to my bucket on cloud storage. this not work for development/local mode and either appengine deployed. in appengine land, I get this error:
I just get permision to bucket:
gsutil acl ch -u user@gmail.com:FULL_CONTROL gs://seektrabajo
the user@gmail.com y get from my google console/ apis-autentications/ Email
![web browser console error][1]
http://i.stack.imgur.com/noKnh.png
Somebody have an idea? Thanks.