I am using PHP for uploading file from sever s1 to server s2 my code is:
// initialise the curl request
$request = curl_init('http://myip/filepath/');
// send a file
curl_setopt($request, CURLOPT_POST, true);
curl_setopt(
$request,
CURLOPT_POSTFIELDS,
array(
'file' => new CurlFile('photos/081452_7893637.jpg')
));
// output the response
curl_setopt($request, CURLOPT_RETURNTRANSFER, true);
echo curl_exec($request);
// close the session
curl_close($request);
When I run the this script the error is:
The requested URL / was not found on this server.
But when i browse it from URL it works fine. Could anyone help please what is wrong with my script? Thanks