laravel-notification-channels / telegram

✈️ Telegram Notifications Channel for Laravel
https://laravel-notification-channels.com/telegram/
MIT License
989 stars 165 forks source link

Why image uploaded Telegram message is broken in 41 b size? #161

Closed sergeynilov closed 1 year ago

sergeynilov commented 1 year ago

In laravel app (9.19) with guzzlehttp(7.2 ) and "laravel-notification-channels/telegram (3.0 ) I send image attached to post request like :


    $response = Http::attach('document', $fileUrlToUpload, 'document.png')
        ->post(self::telegramApiUrl.$this->telegramBotToken.'/sendDocument', [
        'chat_id' => $this->channelUserId,
        'reply_to_message_id' => $replyId
    ] );

where $fileUrlToUpload - is valid url to image at my local hosting (I work on kubuntu 20.04 with apache2). and $telegramApiUrl = 'api.tlgr.org/bot'; My message at appers at Telegram channel, but image in Telegram message is broken and has 41b in size.

I replaced value of $fileUrlToUpload with accessible image url, but anyway image in Telegram message is broken and has 41b in size.

How that can be fixed ?

Thanks!

irazasyed commented 1 year ago

That's not how you would attach an image. Refer readme.