
- Tanga
- Telegram
- Admin
- Optimizatsiya
A video is uploaded once, not for every user
126
The Tanga admin panel could only broadcast text. Announcing a new feature with a short screen recording was the obvious next step.
The naive way is to upload the video to Telegram again for every recipient. With a 20 MB file and a hundred users that is two gigabytes of traffic and a broadcast that drags on.
Telegram has a better mechanism: after the first upload it returns a file_id, and any later message can use that id instead of the file. So the panel uploads the video exactly once — to my own chat, which also gives me a preview — and then sends everyone the file_id.
Two details made it robust. The video arrives as the raw request body, so the panel didn't need a new library for multipart forms. And the file is checked by its first bytes, not by its name: MP4, MOV or WebM up to 50 MB, the upload limit for bots.
If my chat can't be reached, the first recipient takes over the upload, and everyone else still gets the reference.
Takeaway: when a platform stores files for you, send the reference, not the file.