第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號(hào)安全,請(qǐng)及時(shí)綁定郵箱和手機(jī)立即綁定
已解決430363個(gè)問題,去搜搜看,總會(huì)有你想問的

發(fā)送 xls 文件 Telegram 機(jī)器人

發(fā)送 xls 文件 Telegram 機(jī)器人

PHP
郎朗坤 2023-04-15 20:43:34
我正在嘗試發(fā)送一個(gè) xls 文件。上網(wǎng)查了2個(gè)小時(shí),也沒搞清楚哪里出錯(cuò)了。我正在嘗試從 url 發(fā)送此文件。這是我的代碼$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);
查看完整描述

1 回答

?
躍然一笑

TA貢獻(xiàn)1826條經(jīng)驗(yàn) 獲得超6個(gè)贊

目前不支持通過 url 發(fā)送 xls 文件。

通過 URL 發(fā)送- 在 sendDocument 中,通過 URL 發(fā)送目前僅適用于gif、pdfzip文件。

要解決此問題,您可以先將 xls 文件存儲(chǔ)在您的系統(tǒng)上并使用此文件 - 而不是 url。

一種方法是:

$url_of_file = $dburl."Last_season.xls";

$file_name = basename($url_of_file);

file_put_contents( $file_name,file_get_contents($file_name)); //store xls file named "Last_season.xls" locally

$document = new CURLFile($file_name);

$post_data = ["chat_id" => ADMIN_CHAT_ID, "document" => $document];


查看完整回答
反對(duì) 回復(fù) 2023-04-15
  • 1 回答
  • 0 關(guān)注
  • 213 瀏覽

添加回答

舉報(bào)

0/150
提交
取消
微信客服

購課補(bǔ)貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動(dòng)學(xué)習(xí)伙伴

公眾號(hào)

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號(hào)