PHP图像上传到Amazons3错误:无法显示,因为它包含错误


PHP image upload to Amazon s3 error: cannot be displayed because it contains errors

我正在将图像从PHP上传到Amazon S3服务器
它存储成功,但我无法打开图像;我得到这个错误:

图像"https://s3.amazonaws.com/buckename/24aaffa670e634a7da9a087bfa83abe6_400x400.png"无法显示,因为它包含错误。

这是我的代码:

$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))
$value="SampleVideo1.mp4";
$disk = 'Storage::disk('s3');
if ($disk->exists($value)) 
{
    $command = $disk->getDriver()->getAdapter()->getClient()->getCommand(
              'GetObject', [
                  'Bucket'  => 'Config::get('filesystems.disks.s3.bucket'),
                   'Key'    => $value,
               ]);
    $request = $disk->getDriver()->getAdapter()->getClient()->createPresignedRequest($command, '+10 minutes');
    $generate_url = $request->getUri();
    echo $generate_url;
}