I am new to php, can anyone tell me how to send an image file from one server to the other server using cURL in php
My Local host code is:
$sourceurl = "//localhost:8080...../example.jpg";
function writefile($sourceurl, NewImageName.jpg){
$fp = fopen ($image_file, 'w+');
$ch = curl_init($image_url);
curl_setopt($ch, CURLOPT_FILE, $fp);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($ch, CURLOPT_TIMEOUT, 1000);
curl_exec($ch);
curl_close($ch);
fclose($fp);
}
The above code is working fine and created the image file within this page directory, where as I need to change the directory locally (like to desktop) or other SERVER directory to create the image file.