| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Name | Name | Last commit date | ||
|---|---|---|---|---|
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.
const fetch = require('node-fetch');
const FormData = require('form-data');
const { fromBuffer } = require('file-type');
const cheerio = require('cheerio');
/**
* Upload image to url
* Supported mimetype:
* - `image/jpeg`
* - `image/jpg`
* - `image/png`
* - `video/mp4`
* - `all files`
* @param {Buffer} buffer Image Buffer
*/
module.exports = async (buffer) => {
let { ext } = await fromBuffer(buffer);
const bodyForm = new FormData();
bodyForm.append("file", buffer, "file." + ext);
const response = await fetch("https://uptele.onrender.com/api/upload", {
method: "POST",
body: bodyForm,
});
const html = await response.text();
const $ = cheerio.load(html);
const resultUrl = $('input.highlight-url').first().val();
return resultUrl
} git clone https://github.com/hostinger-bot/uploader
cd uploaderInstall dependencies:
npm installCreate 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-idRun the application in development mode:
npm startFor a production build:
npm run buildNote: Build files will be saved in the dist folder.
For dev run
npm run devAccess the application in your browser: http://localhost:3000
Type /start or something on your bot
MIT License. See LICENSE file for details.
| Back | FazBrowse Home | New Git URL |