I\'m not asking about uploading a file from a browser to a php script, there\'s plenty of tutorials about that already. I\'m asking about this:
I have a php script t
You can use CURL for this. Something like this should do it.
$ch = curl_init();
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, array('file' => '@/path/to/file.txt'));
curl_setopt($ch, CURLOPT_URL, 'http://server2/upload.php');
curl_exec($ch);
curl_close($ch);
You can then handle the the server2 part as a regular file upload. See curl_setopt() for more information on those options.