You need to send a file (image) to this site. They have an API . I try to send from a local site (on OpenServer'e), if I substitute the address of a picture on the Internet, then all the rules, and if I specify in the same way (full URL) on my local "site", I get an error 403 (error on the resource).
$img_name_loc = '33.jpg'; // $ ch = curl_init (' http://uploads.ru/api?upload=http://www.bugaga.ru/uploads/posts/2017-03/1488368729_v-parke-yellouston-11.jpg&thumb_width=800&format= json '); // <- this is how it works
$ch = curl_init('http://uploads.ru/api?upload=http://site.loc/uploads/'.$img_name_loc.'&thumb_width=800&format=json'); // <- **так НЕ работает** curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true); curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); $html = curl_exec($ch); curl_close($ch); ideally, it would generally send directly from <input id="uplimg" type="file" accept="image/*"> suspect that one of the problems is that it is a localhost.
$ch = curl_init('http://uploads.ru/api?upload=http://site.loc/uploads/'.$img_name_loc.'&thumb_width=800&format=json');- medvedev