I'm trying to upload youtube videos to aws S3 bucket. The video is getting uploaded properly but they aren't playing properly. I have written this piece of code:
Tried Code:
$uploadPath = "videouploads/$parsed.mp4";
file_put_contents($uploadPath, file_get_contents($dowloadUrl));
// @formatter:off
$result = $s3->putObject(array(
'Bucket' => 'MY_BUCKET',
'Key' => 'MY_OBJECT_KEY',
'SourceFile' => $uploadPath,
));
It will upload the video on my s3 bucket. But when I'm retrieving it using cloudflare the url will be like: