Skip to content

Today I learned

How do I repost a video to a Telegram channel without uploading the file again?

· updated #DevOps and tooling #Web development

My video job renders an MP4, sends it to me in a private chat, and exits. Hours later a different service (the website) has to post the same video to a channel, and by then the file is gone.

Keep the file_id from the first send and pass it instead of the file. Telegram reuses the upload, and the size limit for multipart uploads doesn't apply:

js
// 1. The job: upload once, keep the id
const res = await bot('sendVideo', form) // multipart with the MP4
const fileId = res.result.video.file_id   // save it next to the record

// 2. Later, anywhere: no file, just the id
await bot('sendVideo', { chat_id: '@my_channel', video: fileId, caption })

Three rules I hit:

  1. A file_id belongs to the bot that got it. The service that reposts must use the same bot token.
  2. Resend with the same method: a video id goes back through sendVideo, not sendDocument.
  3. Read file_id from the API response. If you shell out to a send script, make it print the id (I print one JSON line), or you lose it.

I hit this while wiring my TIL Shorts pipeline: the Cloud Run job sends me the Short to review, and when it goes public on YouTube the site posts that same upload to the channel by file_id.

Docs: Telegram Bot API, sending files

Share LinkedIn Post on X

Related notes

Newsletter

Occasional notes on engineering, game tech, and new tools — no spam, unsubscribe anytime.

Ravy

Engineering manager, founder, and software developer building web platforms, game systems, real-time services, and automation tools. 15 years of shipped work — currently at Gaijin.net.

Get in Touch

Building an MVP, shipping a game feature, or automating a team workflow? Open source or paid — let's talk.

Contact Me
© 2020-2026 XPLOIT FZE. All trademarks, names and logos belong to their respective copyright holders.