I Built a File Upload/Download Service Out of Frustration

2 min read
I  Built a File Upload/Download Service Out of Frustration

A common problem that I encountered while managing Linux servers is that it wasn't easy to transfer files. It sure is easy to transfer files to and from a computer that you are using to connect to the server via SCP or SSH but when it comes to transferring files to other computers and most especially, to your mobile phone is another problem that will take several steps to solve.

Why not use some of the popular file storage services?

Like the Drive? (I don't want to be specific).

Pfft! We can but we won't. Why?

  • Often, we are not allowed to install anything on these Linux servers.
  • No one logs in to their drive account inside a Linux server.
Can you download it to your computer and then transfer by other means?

We can but if we are transferring to another computer in another side of the world, it will still take the same effort of transferring using the Drive.

My solution

Before coming up with a solution, I want to have these things:

  • Simple - Very simple upload, no logins, no complicated apps to download.
  • Just use cURL - Upload using cURL or any terminal applications already available in a Linux server.
  • Notify myself (maybe via email) - I have an email address, you have it too. I just want to upload a file and automatically notify myself or someone else. Email is the way, for now. (I have plans to use SMS).
  • Expiring files - Automatically delete the files. Simply because I am paying for the storage (laughs).
  • QR Code in the terminal! - A QR Code to the uploaded file will be very handy if I want to download the file that I uploaded directly to my phone.

So I built pfft free file transfer out of my frustrations (that's why the name is pfft). Plus, it is a recursive acronym.

To use pfft with cURL, run the following command:

curl -X POST https://pfft.sh -F "file=@file.txt"

After uploading, the server responds with a QR code that you can scan using your mobile phone. How handy?

You can also send an email notification containing the download link.

curl -X POST https://pfft.sh -F "file=@file.txt" -F "notify-email=ronmarti18@gmail.com"

You can also upload and download from a browser. Just go to https://pfft.sh/.

What's next?

  • I already added support for HTTPie. If you want to request support for other applications, just shoot me an email.
  • For now, files only stay for 24 hours but could be extended if I could get funding.
  • Nice-to-haves include SMS notification, compressing files before downloading them (zip, etc.) and other integrations (ping me!)

Read more articles like this in the future by buying me a coffee!

Buy me a coffeeBuy me a coffee