$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'http://uploads.ru/api?');
curl_setopt($ch, CURLOPT_POST, true);
$img = new CURLFile($_POST['localpath']);
curl_setopt($ch, CURLOPT_POSTFIELDS, array(
"upload" => $img,
"format" => "json"
));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$result = json_decode(curl_exec($ch));
echo $result;
$url = $result -> data -> img_url;
echo "Код: ".$result->status_code;
curl_close($ch);