An API to send files with one unique code that will let you download your file without * let trace on any server.
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:
- 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:
Now let's try uploading a PDF:
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:
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.
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.