Uploading files from terminal on file hosting service, and unlimited cloud storage
Tags: linux, linuxtricks, upload, terminal
Published: 2023-05-15 14:29:01

In this post I will show you how you can upload files anonymously  directly from your terminal, and can have unlimited cloud storage all for free.
<!--more-->

*BayFiles is a website and file hosting service created by two of the founders of The Pirate Bay.
BayFiles works by letting users upload files to its servers and share them online. Users are provided with a link to access their files, which can be shared with anyone on the internet so that they can download the files associated with the particular link. A unique aspect of this file hosting service is that it does not provide a search function for its users or any sort of file directory that could be used to navigate its online file base. BayFiles can be used and accessed by people without requiring them to sign up for it.*
Source: [Wikipedia](https://en.wikipedia.org/wiki/BayFiles)
Another similar popular service is [anonfiles](https://anonfiles.com/).

## Searching for the API
As you can see when you open the [anonfiles.com](https://anonfiles.com/), there is an option of API at the bottom of the page.
https://anonfiles.com/docs/api

## Understanding the API
The request example under upload in the aforementioned link is:
```curl -F "file=@test.txt" https://api.anonfiles.com/upload```
So as we can see in the above command they're using curl. curl  is  a  tool  for transferring data from or to a server. We also need to replace test.txt with the name of the file we want to upload.

## Installing curl
You can use package manager on the distro of your choice to install curl.
For Ubuntu/Debian based distros:
```sudo apt-get install curl```
For Arch Linux:
```sudo pacman -S curl```

Many linux distros comes with curl preinstalled. To check the version of curl installed on your system type:
```curl -V```

## Uploading files
For demonstration I am going to upload a file named "26bugc.jpg"
You would also need to change the current directory to the directory where the file you want to upload is stored.
The file I am uploading is stored in my home directory.

Replacing the test.txt with the file name:
```curl -F "file=@26bugc.jpg" https://api.anonfiles.com/upload```
Output:
```{"status":true,"data":{"file":{"url":{"full":"https://anonfiles.com/f7LaKftby3/26bugc_jpg","short":"https://anonfiles.com/f7LaKftby3"},"metadata":{"id":"f7LaKftby3","name":"26bugc.jpg","size":{"bytes":97116,"readable":"97.12 KB"}}}}}```

![screenshot](https://i.imgur.com/joHGYx8.png)

The full and short URL above are the link to our uploaded file.
Full: https://anonfiles.com/f7LaKftby3/26bugc_jpg
Short: https://anonfiles.com/f7LaKftby3

## [Frequently Asked Questions](https://anonfiles.com/faq):
**How long will my files be online?**
For as long as possible unless the file violates our Terms of Use.

**What are the limit of uploads?**
You are free to upload as long as you don't exceed the following restrictions:
Max 20 GB per file
Max 500 files or 50 GB per hour.
Max 5,000 files or 100 GB per day.

**Any restrictions on downloads?**
No. We do not enforce any form of bandwidth limitations on downloads.

## Similar / Alternatives
I have curated similar websites, which works exactly like the one we saw above:

* [anonfiles](https://anonfiles.com/):
```curl -F "file=@test.txt" https://api.anonfiles.com/upload```
* [BayFiles](https://bayfiles.com/):
```curl -F "file=@test.txt" https://api.bayfiles.com/upload```
* [openload](https://openload.cc/):
```curl -F "file=@test.txt" https://api.openload.cc/upload```
* [Lolabits](https://lolabits.se/):
```curl -F "file=@test.txt" https://api.lolabits.se/upload```
* [vShare](https://vshare.is/):
```curl -F "file=@test.txt" https://api.vshare.is/upload```
* [hotfile](https://hotfile.io/):
```curl -F "file=@test.txt" https://api.hotfile.io/upload```
* [Rapidshare](https://rapidshare.nu/):
```curl -F "file=@test.txt" https://api.rapidshare.nu/upload```
* [Upvid](https://upvid.cc/):
```curl -F "file=@test.txt" https://api.upvid.cc/upload```
* [Letsupload](https://letsupload.cc/):
```curl -F "file=@test.txt" https://api.letsupload.cc/upload```
* [Megaupload](https://megaupload.nz/):
```curl -F "file=@test.txt" https://api.megaupload.nz/upload```
* [MYfile](https://myfile.is/):
```curl -F "file=@test.txt" https://api.myfile.is/upload```
* [filechan](https://filechan.org/):
```curl -F "file=@test.txt" https://api.filechan.org/upload```

Each of these privacy oriented file hosting service is absolutely free, has no time limit, provides unlimited bandwidth, 20GB filesize limit, and unlimited file storage. You can also upload files on these websites directly from your browser of use your terminal like we've learnt above. Although these files are not listed anywhere and cannot be accessed by anyone on the internet without the link, if you want to upload some private and personal files consider encrypting them before uploading so only you can access them.