public function uploadToAWS($filePath)
{
$s3 = $this->_getS3Object();
$file = $s3->inputFile($filePath);
$headers = craft()->imager->getSetting('awsRequestHeaders');
if (!isset($headers['Cache-Control'])) {
$headers['Cache-Control'] = 'max-age=' . craft()->imager->getSetting('awsCacheDuration') . ', must-revalidate';
}
if (!$s3->putObject($file, craft()->imager->getSetting('awsBucket'), ImagerService::fixSlashes(craft()->imager->getSetting('awsFolder') . '/' . str_replace(craft()->imager->getSetting('imagerSystemPath'), '', $filePath), true, true), \S3::ACL_PUBLIC_READ, array(), $headers, $this->_getAWSStorageClass())) {
ImagerPlugin::log("Upload to AWS failed for {$filePath} in ImagerService", LogLevel::Error);
}
}