Based on the message it looks like an S3 problem, not a Zend Framework problem.



Mark

On Fri, Aug 27, 2010 at 11:05 AM, Antonio Caccese
<[email protected]> wrote:
> Il 27/08/2010 17:53, Antonio Caccese ha scritto:
>
> Hi,
> i get error when send objects to Amazon S3.
> This is my code:
>
> $filename = "name-of-the-file";
>
> $s3 = new Zend_Service_Amazon_S3();
>
> try {
>             $permissions = array(Zend_Service_Amazon_S3::S3_ACL_HEADER =>
> Zend_Service_Amazon_S3::S3_ACL_PUBLIC_READ);
>
>             $s3->putObject(
>                 'bucket-name/' .  $filename,
>                 file_get_contents(PATH_FILES. '/' . $filename),
>                 $permissions
>             );
>         } catch (Zend_Service_Amazon_S3_Exception $s3e) {
>             ......
>         } catch (Zend_Http_Client_Exception $hce) {
>             ......
>         }
>
>
> It works fine for small files but fails on files bigger then 1MB.
> This is the Exception StackTrace:
>
> Read timed out after 10 seconds
>
> #0 C:Program
> FilesZendZendServershareZendFrameworklibraryZendHttpClientAdapterSocket.php(330):
> Zend_Http_Client_Adapter_Socket->_checkSocketReadTimeout()
> #1 C:Program
> FilesZendZendServershareZendFrameworklibraryZendHttpClientAdapterSocket.php(335):
> Zend_Http_Client_Adapter_Socket->read()
> #2 C:Program
> FilesZendZendServershareZendFrameworklibraryZendHttpClient.php(992):
> Zend_Http_Client_Adapter_Socket->read()
> #3 C:Program
> FilesZendZendServershareZendFrameworklibraryZendServiceAmazonS3.php(581):
> Zend_Http_Client->request('PUT')
> #4 C:Program
> FilesZendZendServershareZendFrameworklibraryZendServiceAmazonS3.php(411):
> Zend_Service_Amazon_S3->_makeRequest('PUT', 's3.onweb.it/sit...', NULL,
> Array, '????;?Exif??II*...')
> #5 C:Program
> FilesZendApache2htdocsrevapplicationmodulescorecontrollersElementiController.php(135):
> Zend_Service_Amazon_S3->putObject('s3.onweb.it/sit...',
> '????;?Exif??II*...', Array)
> #6 C:Program
> FilesZendZendServershareZendFrameworklibraryZendControllerAction.php(513):
> Core_ElementiController->uploadS3Action()
> #7 C:Program
> FilesZendZendServershareZendFrameworklibraryZendControllerDispatcherStandard.php(295):
> Zend_Controller_Action->dispatch('uploadS3Action')
> #8 C:Program
> FilesZendZendServershareZendFrameworklibraryZendControllerFront.php(954):
> Zend_Controller_Dispatcher_Standard->dispatch(Object(Zend_Controller_Request_Http),
> Object(Zend_Controller_Response_Http))
> #9 C:Program
> FilesZendZendServershareZendFrameworklibraryZendApplicationBootstrapBootstrap.php(97):
> Zend_Controller_Front->dispatch()
> #10 C:Program
> FilesZendZendServershareZendFrameworklibraryZendApplication.php(366):
> Zend_Application_Bootstrap_Bootstrap->run()
> #11 C:Program FilesZendApache2htdocsrevpublicindex.php(29):
> Zend_Application->run()
> #12 {main}
>
>
> How can fix it?
> Thanks
>
> Antonio
>
>
>
> Now i notice a strange behaviour. I'm sending a file to amazon s3 by an ajax
> request. By Firebug i see that the request return the following html page:
>
> <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
> <html><head>
> <title>200 OK</title>
> </head><body>
> <h1>OK</h1>
> <p>The server is temporarily unable to service your
> request due to maintenance downtime or capacity
> problems. Please try again later.</p>
> </body></html>
>
>
> The file is correctly sent to Amazon S3 but the requests fails.
>
> Please help me!
>
>
>
>
>
>



-- 
Have fun or die trying - but try not to actually die.

Reply via email to