I am using the official PHP SDK with the official service provider for laravel to upload an image to Amazon S3. The image is temporarily stored on my server and should be de
Yes the stream upload locks the file till it finishes, Try either of 2,
$client = AWS::createClient('s3');
$fileContent = file_get_contents($temp_path);
$result = $client->putObject(array(
'Bucket' => self::$bucketName,
'Key' => 'screenshot/testing.png',
'Body' => $fileContent,
'ACL' => 'public-read'
));
);
unlink($temp_path);
or
$client = AWS::createClient('s3');
$fileContent = file_get_contents($temp_path);
$result = $client->putObject(array(
'Bucket' => self::$bucketName,
'Key' => 'screenshot/testing.png',
'Body' => $fileContent,
'ACL' => 'public-read'
));
);
gc_collect_cycles();
unlink($temp_path);