Friday, 6 September 2013

Front controller freezes when uploading file to amazon s3

Front controller freezes when uploading file to amazon s3

I have a Symfony app which receives a .zip file, unzips it and then
uploads all images to Amazon S3 (Using the PHP SDK 2), that's working
nicely.
The problem is while it's uploading I can't use the front controller
anymore, it has to wait until it finishes uploading. If I upload using
app_dev.php I can't access any url based on that front controller until
the upload finishes, app.php requests work just fine.
Is there a way I can somehow bypass that limitation? The code I'm using to
upload is
$client->putObject(array(
'Bucket' => $this->container->getParameter('aws_bucket'),
'Key' => $someKey,
'Body' => fopen($somePath, 'r+'),
));
One solution could be, create another controller and use it to handle the
uploads, but still, it could handle only one upload at a time...
Thanks in advance.

No comments:

Post a Comment