Giter VIP home page Giter VIP logo

Comments (12)

levlam avatar levlam commented on July 18, 2024

The files are downloaded to bot's folder inside server's working directory. You need to set up your HTTPS server serve static files from subfolders of these folders. "/file/bot<token>/path/file_id.ext" should be translated to a path "<server's working directory>/<token>/path/file_id.ext".

from telegram-bot-api.

zickkeen avatar zickkeen commented on July 18, 2024

That means we have to set up an http/https server to serve these folders/files?

from telegram-bot-api.

levlam avatar levlam commented on July 18, 2024

Yes. You already have a HTTPS server to serve https://hostlocal.api. You need to set up it to serve files also.

from telegram-bot-api.

zickkeen avatar zickkeen commented on July 18, 2024

can we run telegram-bot-api in https mode?

from telegram-bot-api.

levlam avatar levlam commented on July 18, 2024

No. You must have an SSL-terminating web server,

from telegram-bot-api.

noplanman avatar noplanman commented on July 18, 2024

I'm busy implementing this functionality to the @php-telegram-bot

@levlam So basically tdlib does not offer any way to access the files via its internal HTTP server?
i.e. We need to set up a separate webserver that proxies the files?

from telegram-bot-api.

levlam avatar levlam commented on July 18, 2024

@noplanman Yes. Bot API server downloads files and saves them locally. In --local mode it returns full path to the file, otherwise it returns a relative path to the file, which can be then served using any HTTPS server.

from telegram-bot-api.

noplanman avatar noplanman commented on July 18, 2024

@levlam Ok, thanks for the confirmation 👌

from telegram-bot-api.

marcoslp010 avatar marcoslp010 commented on July 18, 2024

If you, like me, are not willing to create a server just to serve files, you can change the url to the default Telegram url (api.telegram.org), here it worked perfectly

from telegram-bot-api.

levlam avatar levlam commented on July 18, 2024

@marcoslp010 You must not use api.telegram.org and a local server at the same time.

from telegram-bot-api.

marcoslp010 avatar marcoslp010 commented on July 18, 2024

@marcoslp010 You must not use api.telegram.org and a local server at the same time.

use and only for downloading attachments

from telegram-bot-api.

AYMENJD avatar AYMENJD commented on July 18, 2024

@marcoslp010 You must never use them both for any purpose. Even for downloading. Otherwise you will ran into too many issue with your bot.

from telegram-bot-api.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.