FileShare - Secure File Uploader
FileShare is a simple web application for securely uploading and sharing files using the Telegram Bot API. It allows users to upload files up to 50MB, retrieve download URLs, and copy URLs easily.
- File Upload: Supports all file types up to 50MB.
- Download URLs: Each uploaded file gets a unique download URL.
- Responsive Design: User-friendly interface for both desktop and mobile devices.
- Security: Telegram token stored in
.env
to prevent leaks.
- Node.js (version 18 or higher)
- npm
- Telegram account with a Bot Token and Chat ID
- Clone this repository:
git clone https://github.com/hostinger-bot/uploader
cd uploader
-
Install dependencies:
npm install
-
Create a
.env
file in the project root and add your Telegram Bot Token and Chat ID:TELEGRAM_TOKEN=your-telegram-bot-token TELEGRAM_CHAT_ID=your-chat-id
-
Run the application in development mode:
npm start
-
For a production build:
npm run build
Note: Build files will be saved in the
dist
folder. -
For dev run
npm run dev
-
Access the application in your browser: http://localhost:3000
- express: Web framework for Node.js.
- multer: Middleware for handling file uploads.
- axios: For making HTTP requests to the Telegram API.
- form-data: For uploading files to Telegram.
- sanitize-filename: To ensure safe file names.
- pug: Template engine for rendering HTML.
- express-rate-limit: To limit request rates.
- morgan: For HTTP request logging.
- dotenv: To load environment variables from
.env
.
- Telegram Limitations: The Bot API has a 50MB file size limit. For files up to 2GB, you need to run a local Bot API server.
- Security: Never commit the
.env
file to a public repository. Ensure.env
is listed in.gitignore
. - Production Build: The
dist
folder is included in Git for easy deployment. Runnpm run build
before deploying.
- Fork this repository.
- Create a feature branch: git checkout -b feature/feature-name
- Commit your changes: git commit -m "Add feature-name feature"
- Push to your branch: git push origin feature/feature-name
- Create a Pull Request on GitHub.
MIT License. See LICENSE file for details.