i'm trying to send a xls file. Looking online and after 2 hours, I didn't figure out where is it the error. I'm trying to send this file from an url. Here's my code
$filePath = $dburl."Last_season.xls";
$document = new CURLFile($filePath);
$post = array('chat_id' => $callback_id_username,'document'=> $document,'caption' => $caption);
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL,$GLOBALS[website]."/sendDocument");
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $post);
$result_curl = curl_exec ($ch);
curl_close ($ch);