Files in. Links out.
Send a file to your Telegram bot and get a public download link from File2Share. Send a public file URL to receive it on Telegram.
UploadBot passes file chunks straight from Telegram into the upload request. Uploading starts before downloading finishes, with bounded buffers and no temporary files on the bot host.
Telegram -> 512 KiB chunks -> UploadBot -> File2Share -> Download link
- Large files and albums streamed through File2Share's numbered-part API.
- Resilient transfers with failed-part retries, speed, ETA, and cancellation.
- Your choice of host with File2Share, compatible PUT hosts, or WebDAV.
- Private history with filename search, download buttons, and remote deletion.
- Optional encryption with a separate key and a local decryption command.
- Simple hosting with uv, Docker Compose, and an optional user allowlist.
You need uv, Python 3.11+, a bot token from BotFather, and an API ID/hash from my.telegram.org/apps.
git clone https://github.com/IlyaKhalafi/UploadBot.git
cd UploadBot
cp .env.example .env
# Fill in API_ID, API_HASH, and BOT_TOKEN in .env.
uv sync --locked --no-dev --extra speed
uv run --no-sync uploadbotNo File2Share account or hosting API key is required. For a personal bot, set
ALLOWED_USER_IDS in .env to your numeric Telegram user ID.
| Send in a private chat | Result |
|---|---|
| A document, photo, video, or audio file | A public download URL |
| A public HTTP(S) file URL | The file sent back through Telegram |
/start or /help |
Commands and the configured file limit |
/cancel |
Stop your active transfer |
/files report |
Find recent uploads by filename |
/provider, /expiry, /encrypt |
Choose settings for future uploads |
Voice messages and animations work too. File URLs must be accessible to Telegram without browser cookies or a login.
The default file limit is 2 GB, subject to Telegram's own limits. File2Share's numbered-part API supports files up to 50 GB when the operator raises the limit. The host keeps files for up to 14 days, and limits uploads to 40 per hour per IP address. Anyone with the link can download the file. Some file types, including programs and web pages, must be archived first. See the host's API guide.
Use /expiry 2 for shorter retention or /encrypt on for encrypted uploads.
Keep the separate key message. See commands and providers
and decrypting files.
Configure .env, then start the bot.
docker compose up --build -d
docker compose logs -f botThe container runs as a non-root user and persists the Telegram session in a named volume. No incoming port is needed.
- Setup and configuration for every setting and custom upload hosts.
- How streaming works for flow control and failure handling.
- Contributing for development commands and tests.
- Migration notes for older installations.
MIT licensed. If UploadBot saves you time, a star helps others find it.