Zend framework 通过zend framework 1将图像上载到amazon s3
我想用我的代码将我的图像上传到zend framework中的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
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这样的公共论坛上展示这些密钥。