C. Hinsley
28 June 2024
I recently found myself to have a handful of simultaneous problems:
I found that Telegram provides unlimited total storage in free accounts and permits up to 2 gigabytes per file, and once you have uploaded a file to them you can transfer it to other people instantly. Plus, you can caption/tag your files to make them searchable. However, Telegram can snoop on the data you put on their servers.
To overcome the file size limitation, I made a Progressive Web App that takes files on your computer, partitions them into 2 gigabyte chunks, gzip-compresses them, and AES-256-CTR encrypts them (with an optional encryption password), then stores them in your Telegram “Saved Messages” chat. Since the chunks are treated by the Telegram application as files, you don’t want to manipulate them yourself through the chat application (since you can corrupt a full file if you do anything to them yourself) — instead the application provides basic manipulation and sending/receiving functionality.
The application is live at https://tglfs.vercel.app (TGLFS is an acronym for TeleGram Large File Storage). Since it’s a PWA, it works on any operating system that has a modern web browser, including mobile operating systems, and it can be installed as an application (on desktop browsers you get a pop-up in your address bar, while on iOS/Android you can just add it to your home screen and it’ll silently install properly). I could also add it to app stores but I don’t want to pay them anything.
The login screen.
TGLFS uses Gram.js to communicate with Telegram servers. You need to provide TGLFS with your own account’s access to use TGLFS (but don’t worry, TGLFS is open source and you can run your own instance if you’re paranoid). You’ll need to create a Telegram account first, if you don’t have one — using a phone is the easiest way, and you need a phone number anyway. You then need to acquire an API ID and API Hash for your account. To get these, click the grey Register for Telegram API
button at the bottom of the login interface. You’ll be taken to the page shown below:
Don’t worry, I know it says “Delete Account”, but that won’t happen unless you click something on the next page for it. Just put in the phone number you registered your Telegram account with. You’ll then receive a verification code via Telegram and subsequently be directed to a page where you can choose to either delete your Telegram account or set up an “application” with the Telegram API. Don’t delete your account. Just set up a new application.
You’ll next be asked to provide some information; you can just use the following (though none of this actually matters at all; you can really just supply whatever you like):
Telegram Large File Storage
tglfs
Web
Large file storage and transfer on Telegram