I am trying to read .docx and .doc files in PHP using CURL with a direct URL, but I am getting some errors.
This is my code:
<?php
function curl_get_contents($url)
{
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
$data = curl_exec($ch);
curl_close($ch);
return $data;
}
$url = "https://msysmhsptkazqgnbycne.s3.amazonaws.com/user/RP_Plagscan_1487681880_8206_WV_1486967057_3815_Working Thesis-12 Jul.docx";
$json = json_decode(curl_get_contents($url));
?>
It shows the following error:
HttpVersionNotSupportedThe HTTP version specified is not supported.AED9E1B975ADE9E9FHiIIYR/l/U5r7WOv3KClqBHKdlTguYBTfnd+tWtI/1UUUznjgm1wHzxrXSWI32pzeeGAKLxYNNgJVdDrqdgwXMYNhJy/Vcl