Closed mjavidm closed 7 years ago
Check if the values of $doc_id and $file seems correct. Then we will investigate about the download function.
yes $doc_id values is hash code like "AgADBAADdKgxG66mEVABIZqHNFIk-PqAAEsAgABAg" $file values is "Array" But $file["file_path"] & $file[0] & $file[1] & $file[2] => output is not show
try this:
$result = $telegram->getData();
$doc_id = $result["message"]["document"] ["file_id"];
$file = $telegram->getFile($doc_id);
$response = print_r($file, true);
$content = array('chat_id' => $chat_id, 'text' => $response);
$telegram->sendMessage($content);
I think there is some error in the telegram response.
I found the problem. I think telegram changed the response from the get file. You should use:
$telegram->downloadFile($file["result"]["file_path"], "./3333333.xls");
$telegram->downloadFile($file["result"]["file_path"], "./3333333.xls");
it's true
very good, thank you
hi, i'm using this code but not work. "file_path" is empty code: $result = $telegram->getData(); $doc_id = $result["message"]["document"] ["file_id"]; $file = $telegram->getFile($doc_id); $telegram->downloadFile($file["file_path"], "./3333333.xls");
i'm sending *.xls files to bot and saved in host but file size is: 0 plz help me tnks