A modern web application built with Go that allows you to upload files directly to Telegram through a beautiful web interface.
- 🚀 Fast and lightweight Go backend
- 🎨 Modern, responsive web UI
- 📤 Upload files up to 50MB to Telegram
- 💬 Support for captions
- 🔒 Secure file handling
- 📱 Mobile-friendly interface
- Go 1.21 or higher
- A Telegram Bot Token (get it from @BotFather)
-
Clone or navigate to the project directory:
cd Uplaoder -
Install dependencies:
go mod download
-
Create a
.envfile:cp .env.example .env
-
Edit
.envand add your Telegram Bot Token:TELEGRAM_BOT_TOKEN=your_bot_token_here DEFAULT_CHAT_ID=your_chat_id_here # Optional PORT=3000 # Optional, defaults to 3000 -
Get your Telegram Bot Token:
- Open Telegram and search for @BotFather
- Send
/newbotand follow the instructions - Copy the bot token and paste it in your
.envfile
-
Get your Chat ID (optional):
- You can use your user ID (numeric) or username (e.g., @username)
- To find your user ID, message @userinfobot on Telegram
- Or leave
DEFAULT_CHAT_IDempty and enter it in the web form
-
Start the server:
go run main.go
-
Open your browser: Navigate to
http://localhost:3000 -
Upload files:
- Enter your Chat ID (or use the default if configured)
- Optionally add a caption
- Select a file
- Click "Upload to Telegram"
go build -o telegram-uploader main.go
./telegram-uploaderUpload a file to Telegram.
Form Data:
file(required): The file to uploadchatId(required): Telegram chat ID or usernamecaption(optional): Caption for the file
Response:
{
"success": true,
"message": "File uploaded successfully",
"fileId": "file_id_from_telegram",
"messageId": 123
}Check server health and configuration status.
Response:
{
"status": "ok",
"botToken": "configured"
}The default file size limit is 20MB, but you can configure it in your .env file:
MAX_FILE_SIZE_MB=20
Telegram Bot API supports files up to 50MB maximum. You can set any value between 1 and 50 MB.
If you're in a country where Telegram is blocked (like Iran), you need to configure a proxy:
-
Add to your
.envfile:HTTP_PROXY=socks5://127.0.0.1:1080Or for HTTP proxy:
HTTP_PROXY=http://127.0.0.1:1080 -
Restart the server
See PROXY_SETUP.md for detailed proxy configuration instructions.
- Make sure you have a
.envfile in the project root - Add your bot token:
TELEGRAM_BOT_TOKEN=your_token_here - Restart the server after creating/editing
.env - Check the health endpoint:
http://localhost:3000/api/health
See SETUP.md for detailed setup instructions.
- Verify your token is correct (no extra spaces)
- Get a fresh token from @BotFather
- Make sure the token format is correct:
123456789:ABCdefGHIjklMNOpqrsTUVwxyz
- Start a conversation with your bot first (send
/start) - Verify your Chat ID is correct
- Use numeric Chat ID or username (e.g.,
@username)
- Never commit your
.envfile to version control - Keep your bot token secure
- Consider adding authentication for production use
MIT License - see LICENSE file for details
Mamd Mehrabi Rad
