Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/amazon-s3/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Zend framework 通过zend framework 1将图像上载到amazon s3_Zend Framework_Amazon S3 - Fatal编程技术网

Zend framework 通过zend framework 1将图像上载到amazon s3

Zend framework 通过zend framework 1将图像上载到amazon s3,zend-framework,amazon-s3,Zend Framework,Amazon S3,我想用我的代码将我的图像上传到zend framework中的amazon s3: require_once('Zend/Service/Amazon/S3.php'); $awsKey = 'PRIVATE'; $awsSecretKey = 'PRIVATE'; $s3 = new Zend_Service_Amazon_S3($awsKey, $awsSecretKey); $a= new Zend_Form_Element_Image('images

我想用我的代码将我的图像上传到zend framework中的amazon s3:

require_once('Zend/Service/Amazon/S3.php'); 
   $awsKey       = 'PRIVATE';
   $awsSecretKey = 'PRIVATE';
   $s3 = new Zend_Service_Amazon_S3($awsKey, $awsSecretKey);
   $a= new Zend_Form_Element_Image('images');
   $bucketName = 'mywebsiteinvietnam';
   $this->view->form = $form;
      if ($this->getRequest()->isPost()) {
        $formData = $this->getRequest()->getPost();
        if ($form->isValid($formData)) {
            $user_name = $form->getValue('user_name');
            $user_email = $form->getValue('user_email');
            //$user_image= $form->getValue('user_image');
            $a = $form->images->receive();
            $posts = new Default_Model_User();
            $perms      = array(Zend_Service_Amazon_S3::S3_ACL_HEADER => Zend_Service_Amazon_S3::S3_ACL_PUBLIC_READ);
            $s3->putFile($a,$bucketName . '/' . $a,$perms);
和我的浏览器显示

error: "Cannot read file 1"
(#0 C:\wamp\www\socialnetwork\application\modules\default\controllers\UserController.php(76): Zend_Service_Amazon_S3->putFile(true, 'mywebsiteinviet...', Array))

我正在努力解决。。。。请帮帮我

那是你真正的aws密钥和秘密密钥吗?我认为你需要重新考虑在stackoverflow这样的公共论坛上展示这些密钥。