我使用谷歌应用引擎在zend上传文件,并收到错误“你的php配置中不允许上传文件!”。
我正在使用代码......
$userId = (int) $this->params('id');
$fName = time().".".$extension;
$options = [ 'gs_bucket_name' => 'googlesurveys001'];
$upload_url = CloudStorageTools::createUploadUrl('/admin/user/add-picture', $options);
$request = $this->getRequest();
if ($request->isPost()) {
$File = $this->params()->fromFiles('name');
$gs_name = $File['tmp_name'];
move_uploaded_file($gs_name, 'gs://googlesurveys001'.'/images/'.$userId.'/'.$fName);
}
任何帮助都会很好。
由于 Manish kumar
答案 0 :(得分:0)
在将action属性设置为$ upload_url后,在表单标记中.Its正常工作。
$upload_url = CloudStorageTools::createUploadUrl('/admin/user/add-picture', $options);
<form action="<?php echo $upload_url?>" enctype="multipart/form-data" method="post">