I'm uploading an image from PHP
to Amazon S3 servers.
It is stored successfully but I am not able to open the image ; I am getting this error:
The image “https://s3.amazonaws.com/buckename/24aaffa670e634a7da9a087bfa83abe6_400x400.png” cannot be displayed because it contains errors.
This is my code:
$sourcePath = $_FILES['filedata']['tmp_name'];
$actual_image_name='dinesh'.$_FILES['filedata']['name'];
$contentType= $_FILES['filedata']['type'];
S3::putObject($sourcePath,
BUCKETNAME,
baseName($actual_image_name),
S3::ACL_PUBLIC_READ,array(),
array('Content-Type' =>$contentType))