Hi I'm trying to use PHP file_put_contents to save a raster file to my local drive. The raster file is acquired by curl request, the url link works perfectly fine if open with browser(file is downloadable), but the file_put_contents won't save anything to the folder. Below is my php pseudo code:
$ch = curl_init(working_url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$save = curl_exec($ch);
curl_close($ch);
file_put_contents($path_of_file, $save);
I have chmod to 777 and have the full write and read to the folder and the save path is correct.