public function uploadFile($url, $path)
{
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_HEADER, false);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_POST, true);
if (class_exists('\CURLFile')) {
curl_setopt($ch, CURLOPT_POSTFIELDS, ['file1' => new \CURLFile($path)]);
} else {
curl_setopt($ch, CURLOPT_POSTFIELDS, ['file1' => "@$path"]);
}
$data = curl_exec($ch);
curl_close($ch);
return json_decode($data, true);
}