Code Monkey home page Code Monkey logo

one-time-api's Introduction

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)

one-time-api's People

Contributors

rooyca avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.