$ch = curl_init('http://127.0.0.0/upload');
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, [
'file' => new \CURLFile($_FILES['file']['tmp_name'])
]);
$result = curl_exec($ch);
if ($result === false) {
$this->error("upload - FAILED");
}
$res = json_decode($result, true);