0

I tried to download a document in my telegram bot hosted in heroku, but in the server (heroku) the file don´t send to user, when this make a request.

In local it´s right and function, the document send with no problem.

This is the code, i use the library gdown to download file to Google Drive:

url = 'link to document in drive (mode view for all with link)'
output = 'List.pdf'
doc = gdown.download(url, output, quiet=False)
bot.sendDocument(chat_id=ChatId, document=open('list.pdf', 'rb'), filename=output)

In local runing the file is downloading without problem But if i send to heroku server with docker and start service, the bot not send to user the PDF.

I created an if when FileNotFoundError (because that error sheds heroku), but always goes to if, and not send the file (I puted a link to view the document, but is not the same)

¿Any idea to solve?

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy