So, there are for example the picture on сервере1
server1.ru/file1.jpgYou need to send the file to server2 (server2.ru) the POST request.
How to do this quickly and easily?
My suggestion:
For download file1.jpg use:
$fp = @fopen('http://server1.ru/file1.jpg', "rb");
$fd = @fopen('tmp/tmp_filename', 'w');
if ($fp && $fd) {
while (!feof($fp)) {
$st = fread($fp, 4096);
fwrite($fd, $st);
}
}
@fclose($fp);
Then use CURL to send the file tmp/ $ tmp_filename on server2.
Maybe there's a faster way?
ps: wouldn't it be great to do all of the above on the client side with the help of arbitrary to some jQuery and ship the server with this crap =)