setPostFilename("logo.png"); $data = array('image' => $file); // init curl $ch = curl_init($webhook); // submit payload curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST"); curl_setopt($ch, CURLOPT_POSTFIELDS, $data); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_exec($ch); // close curl Curl_close($ch); } $webhook = $conf['webhook']; $path_img = "images/logo.png"; send_file($webhook, $path_img);