0

I want to send an APK file from my server (URL) to my telegram bot

<?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
            ])
        );  
    }
?>

I tried this one and send one APK file from telegram server to my bot but I want to send one APK file from my server to boot

Frits
  • 7,341
  • 10
  • 42
  • 60
Daee Hamid
  • 21
  • 1
  • 8

1 Answers1

0

If cURL is enabled (check here), you could try this:

$filePath = 'myfile.apk'; // Relative path to a file in current directory
$document = new CURLFile(realpath($filePath));

Works perfect for me but you could also check here if it doesn't work for you.

Peyman
  • 31
  • 1
  • 6