Skip to content
Advertisement

Telegram sendPhoto with multipart/form-data not working?

Hi I am trying to send an image. The documentation states that I can send a file using multipart/form-data.

enter image description here

Here is my code:

JavaScript

In both cases, I get this response:

JavaScript

Other download methods (by ID and by link) work. Can anyone please point me in the right direction?

Advertisement

Answer

Using the php-telegram-bot library, sendPhoto can be used like so:

JavaScript

The trick is to use Request::encodeFile to read the local image.

User contributions licensed under: CC BY-SA
6 People found this is helpful
Advertisement