I'm saving images to my s3 bucket but although I see the files saved I can't open them. In firefox I get the error "image cannot be displayed because it contains erros". This code worked when saving images to the server so I just changed it to save accordingly to the bucket:
$s3 = S3Client::factory(array(
'region' => $region,
'version' => $version
));
$bucket = "test";
$file_path = $bucket . "/this/is_working/";
try {
$content_type = "image/" . $extension;
// Upload a file.
$result = $s3->putObject(array(
'Bucket' => $bucket,
'Key' => $file_path,
'ACL' => 'public-read',
'ContentType' => $content_type,
'Body' => $_FILES['picture']['tmp_name']
));
As I said, I do see the file with it's name .png but whenever I try to get the link http://region.amazonaws.com/bucket/file
it fails with 'cannot be displayed because contains errors`. Any idea on this one? TYVM for your help...