Telegram-bot-sdk: problem with send photo

Created on 18 May 2017  路  3Comments  路  Source: irazasyed/telegram-bot-sdk

hello
i want send photo stored on my server bot getting error:

CouldNotUploadInputFile in CouldNotUploadInputFile.php line 29: Filename not provided for http://domain.com/XXXXX.jpg. Remote or Resource file uploads require a filename. Refer Docs for more information.

my code:
$this->telegram->sendPhoto([ 'chat_id'=>'XXXXXX', 'photo'=>'http://domain.com/XXXXX.jpg' ]);

Most helpful comment

Latest version (develop branch) must use an InputFile object when sending ANY files.

    \Telegram::bot('sdk')->sendPhoto([
        'chat_id' => '',
        'photo'   => InputFile::create($resourceOrFile, $filename),
        'caption' => '',
    ]);

All 3 comments

Did you try using https url?

@firegore2
yes

Latest version (develop branch) must use an InputFile object when sending ANY files.

    \Telegram::bot('sdk')->sendPhoto([
        'chat_id' => '',
        'photo'   => InputFile::create($resourceOrFile, $filename),
        'caption' => '',
    ]);
Was this page helpful?
0 / 5 - 0 ratings

Related issues

behnamazimi picture behnamazimi  路  3Comments

Visionary89 picture Visionary89  路  5Comments

danilopinotti picture danilopinotti  路  3Comments

wlinh picture wlinh  路  3Comments

realtebo picture realtebo  路  4Comments