/One-Time-API

An API to send files with one unique code that will let you download your file without let trace on any server.

Primary LanguagePython

PyPI - Python Version PyPI - Status PyPI - License

One-Time-API

ONCE-LOGO

An API to send files with one unique code that will let you download your file without * let trace on any server.

How to use

You can check my app on heroku or you can run it yourself. Just clone this repo and install the packets with:

pip install -r requirements.txt

Then:

uvicorn app:app 

Here comes the tricky part... You will need an Azure and Redis account.

If you have one student email you could register in Azure for free and get a trial account with 12 months of duration. (Here is something that you can try if you don't have one).

And you could set one Redis DB here.


Well, once we have everything set let's make some requests. To post data you will need Curl, Python, Postman or whatever you want to use. We are gonna use our browser (Firefox) for now. One thing to have in mind:

  1. There are just some types of files allow to upload (txt, pdf, png, jpg, jpeg, gif, rar, zip, gzip, mp3, mp4, 3gp, wav)

I would try to overcome those limitations in a future version. For now let's upload some files to our API:

If you visit http://127.0.0.1/8000/docs you would see something like this:

END-POINTS

Now let's try uploading a PDF:

UPLOAD

When you press Excecute it should return some information about the file and one code of four digits that we are going to use to download our file. Sometimes it raise an Internal Server Error because a conflict with our local hour

Now, let's go to our other endpoint:

DOWN

If you try to download it from here you would received a lot of strings and things that are not quite your file, so to get our file we are going to use Curl. It's as easy as:

curl http://127.0.0.1:8000/download/{your-id} --output "name-of-your-file.pdf"

And that should be it.

Remember

Once we redeem our code and download the file (or just visualise it) the file is gone for ever, so make sure that you actually save it.

  • This is NOT 100% secure because the server in witch it's been upload is Microsoft property and we all know how is our uncle Bill... So use it carefully or don't use it at all. (Checkout p2p and IPFS)