Comments (12)
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.
That means we have to set up an http/https server to serve these folders/files?
from telegram-bot-api.
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.
can we run telegram-bot-api in https mode?
from telegram-bot-api.
No. You must have an SSL-terminating web server,
from telegram-bot-api.
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.
@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.
@levlam Ok, thanks for the confirmation 👌
from telegram-bot-api.
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.
@marcoslp010 You must not use api.telegram.org and a local server at the same time.
from telegram-bot-api.
@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.
@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)
- Let's imagine that we have a ~4gb file, and a premium subscription on the account. So we are trying to upload the file using preliminary wrappers, we do perform the request, wait until the file is loaded, and chunk are saved on the server-side/cdn whatever, close the database, then we open it again, let's say 10 minutes later, we are trying to upload it, but due to the tdlib cache we just run into a weird situation where the filds 'is_uploading_active' are being set as true in the response to the original 'preliminaryUploadFile', even though the file is already uploaded and the uploaded_size matches the size, and expected_size fields values, while 'is_uploading_completed' is being set to false.
- [Question]: Is `ChatJoinRequest.invite_link` always null for public groups? HOT 1
- How legal is using getChannelDifference for public channels HOT 5
- hajaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaar
- Does telegram-bot-api still not support uploading files up to 4G? HOT 7
- How to create a service on Ubuntu HOT 1
- Tgram.api
- http proxy does not work! HOT 1
- Message entities are not preserved by `editMessageText` and `editMessageMedia` HOT 2
- Request: Add Possibility for bot to publish/maintain stories in Channels
- NOT: User.language_code described at IETF but only being used as ISO-639? HOT 3
- How should I apply for the API HOT 4
- How can I be sure that Telegram BOT API local server is running properly? HOT 4
- Blockquote HTML syntax issues HOT 1
- pending_update_counts delay HOT 15
- get 404 error on download file! HOT 11
- Bot latency HOT 6
- Failed to forward message: 'Bad Request: message thread not found' HOT 7
- Persistent "ERROR" When Creating Telegram Application HOT 6
- Change the maximum upload size HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from telegram-bot-api.