Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/229.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何将文件从服务器发送到电报机器人php_Php_Telegram_Telegram Bot - Fatal编程技术网

如何将文件从服务器发送到电报机器人php

如何将文件从服务器发送到电报机器人php,php,telegram,telegram-bot,Php,Telegram,Telegram Bot,我想从我的服务器(URL)向我的电报机器人发送一个APK文件 <?php if ($update->callback_query->data == "app_dl"){ $chat_id = $update->callback_query->message->chat->id; $document = "BQADBAAD2wADHg4hUfbD3f-YYGc3Ag"; $caption = "te

我想从我的服务器(URL)向我的电报机器人发送一个APK文件

<?php 
    if ($update->callback_query->data == "app_dl"){
        $chat_id = $update->callback_query->message->chat->id;
        $document = "BQADBAAD2wADHg4hUfbD3f-YYGc3Ag";
        $caption = "text";
        var_dump(
            makeHTTPRequest('sendDocument',[
                'chat_id'=>$chat_id,
                'document'=> $document,
                'caption'=> $caption
            ])
        );  
    }
?>

我尝试了这个,并从电报服务器向我的机器人发送了一个APK文件 但是我想从我的服务器发送一个APK文件以引导

如果启用(),您可以尝试以下操作:

$filePath = 'myfile.apk'; // Relative path to a file in current directory
$document = new CURLFile(realpath($filePath));
对我来说很完美,但如果对你不起作用,你也可以