$chat_id, 'photo' => new CURLFile(realpath("/usr/www/ZZZZZ/data/cam.jpg")) // percorso sul proprio server ); $ch = curl_init(); curl_setopt($ch, CURLOPT_HTTPHEADER, array( "Content-Type:multipart/form-data" )); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_POSTFIELDS, $post_fields); $output = curl_exec($ch); echo "The file has been uploaded"; } else { echo "There was an error uploading the file, please try again!"; } ?>