my code works fine but does not perserve filetime/modification date from the server...... i added filetime option to curl but writing the file still writes the file as the moment it was saved (current date) any suggestions? I am visually impaired so if i made mistake sorry , thank you in advance.
$filename = "image.jpg" $imgurl = "http://www.example.com/image.jpg"
$ch = curl_init();
curl_setopt ($ch, CURLOPT_URL, $imgurl);
curl_setopt ($ch, CURLOPT_CONNECTTIMEOUT, $timeout);
// Getting binary data
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_BINARYTRANSFER, 1);
curl_setopt($ch, CURLOPT_FILETIME, TRUE);
$image = curl_exec($ch);
curl_close($ch);
file_put_contents($filename, $image);