I use the code below to download files. Everything works fine, but in the final version, the extension of the downloaded file may be different, is it possible to somehow find out the file extension when downloading it?
code:
$url = 'http://mysite.ru/myfile'; $ch = curl_init($url); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); $data = curl_exec($ch); curl_close($ch); file_put_contents("TendersDocs/1.xlsx", $data);