Cloud storage is pretty expensive these days, especially if you're looking to save as much money as possible. While Google Drive comes with 15GB of storage for free, what if I told you there was a way to have technically infinite storage? I undertook a pretty fun project which involved turning Discord into my own personal Google Drive service, complete with a bypass for storage limits on the service.

How this works is fairly simple: Discord holds onto your files effectively forever, and the recent CDN changes to the service only have an effect on links shared outside of the platform. Within the app, files are accessible forever, so you can use Discord as a file storage medium. I know a few people who use it to store documents and notes in a private server with just themselves, so I decided to take it a step further. With this, you'll be able to host files of any file size on any Discord server, and you'll be able to access them whenever you want.

The source code for this project is at the bottom of the article, but I'll walk you through the program here, its limitations, and how I overcame some of the difficulties along the way.

Do not rely on Discord as a storage medium for important files, as the service could theoretically remove them at any time. As well, sensitive information should not be stored on Discord, as there is no authentication done on file access, aside from authentication enforcement that verifies the download request came from the Discord application within the last 24 hours.

What you'll need

There isn't a lot you really need to have available

If you want to make a Discord bot capable of storing files for you on Discord's CDN, you'll need the following:

  • Fast internet for uploading
  • A computer to run your code on
  • Python or other programming language experience

Once you have all of the above, you'll be able to follow along here. If you don't have any programming experience, don't worry, as the code in the GitHub repository for this project should help you.

Making the Discord bot

You'll need to choose a language, too

Discord has an API that's easy to use and accessible. I'm particularly fond of Python as a programming language, so I used the Discord Python library to interface with the API. There is also a robust Node JS library if you would prefer.

I registered a bot called "Google Drive Replacement Bot", noted my client token, and created a URL to invite the bot to my server. You'll need to make sure it has permissions to read/view messages, to attach files, and to send messages.

Once you've done this and the bot is invited to your server, you're good to go.

👁 Two laptops with a banner stating Python
How to install Python on Windows, Linux, and macOS

If you want to install Python and get started with development, we have a handy quick-start guide to run you through the basics.

Creating the local web server

A simple drag and drop will do

I created a very basic drag and drop window using material design styling, HTML, and JavaScript. The web server is executed in Flask, a Python web server that can handle "templates" of HTML pages. In other words, I can link certain aspects of the page to execute Python code in the background, which is exactly what we'll need to upload files to the server.

For this, you can do basically anything. All you need to make sure is that you have some kind of object acting as a "drop zone" listening for files to land on it, which can then be passed off to your upload function. Before I turned this into a button, it was just text with JavaScript listening for a file that was dragged onto the text. This then takes the file, sends it to a /upload endpoint in Flask, and the Discord bot attaches it to a message that get sent into the server it's active in.

Uploading the files to Discord

This part took me the longest

Taking the files uploaded in the web UI and then forwarding them to Discord took me the longest to figure out, but the problem was essentially two-fold. First, there are safeguards around what kinds of files you can send along with size limits. Secondly, there are security implementations within Discord to ensure that your bot is following the rules correctly, so you need to set permissions and you need to define "intent" in the code so that your bot can know to react to the right things.

In this case, all we want is our bot to be able to send files. It doesn't even really need access to see anything in the server it's in, as all it does is send message attachments. Once I figured all of that out, it was rudimentary to create a background thread that would connect to Discord and could be passed file information to upload. Once I hit the 25MB limit though, I needed to figure out a way to split files up and share them.

At first, I considered using WinRAR and splitting files into multi-part RAR files, but I realized that given files are all just essentially lines of text, you can cut them at any point and reattach them at the same point to get the exact same file. In other words, cutting files at a 20MB limit and reattaching them in the same place will result in a perfectly usable file. We'll get to stitching them later, but the logic for this is fairly simple. Calculate "chunks" of files and upload these individually, with a part number to denote the order they should go in.

This worked perfectly! It also gets around the file extension problem, as the part number adds a new file extension that's just "part*", where * is a number. Stitching them together is the next part, but it's easy to do thanks to the way that we initially cut them up.

Retrieving and stitching the files together

Making sure the hashes match

To demonstrate how this works, I uploaded the LM Studio Mac installer to the Discord server I was in with my bot. I downloaded each part and wrote a script that reads each part number, sorts them in order, and then reattaches them together into a file determined by the user. The directory and output file names are optional, as it will just use the current directory and the input file name you give (without the ".part*" at the end) to determine the final file output.

The files that you get through this method are byte-for-byte identical to the original, though the method of retrieval is cumbersome. You need to download each file individually and stitch them back yourself. In the future, this program could be expanded to store a database of files in the web UI that can be redownloaded by the user, but because of Discord's requirements for downloading through the Discord app, may require a bit of work to figure out.

You can verify the authenticity of the original file and the combined file through the shasum command on Mac, and Windows and Linux have similar tools that you can use to verify, as well.

How to run this yourself

It's pretty easy

If you want to run this yourself, I made a GitHub repository containing the source code and installation instructions. You'll need to give stitch.py to anyone that you want to share files with, but we recommend only using this privately. You can run the upload script on any device that you want, including a NAS or spare laptop if you just want it available to your network at any time. You don't need to run it individually on each device you want to upload on.

👁 TerraMaster and Asustor NAS
Best NAS devices in 2025

Expand your PC storage with one of these NAS enclosures

Again, we don't recommend actually relying on this as a form of cloud storage, but it's a fun proof of concept to play with. If you want to expand on it or deploy it yourself, you'll need to make sure to set the client token and the channel ID in app.py before it'll work. The Flask console will give you all of the debugging information you need to figure out what you need if it isn't working, so be sure to pay attention to it!