andreasjansson / docker-file-upload-server

Simple file upload server for testing

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

File upload server

Simple file upload server for testing

Usage

$ docker run -it -p 5000:5000 ghcr.io/andreasjansson/docker-file-upload-server:main

Then you can send files to the server:

$ echo hello world > my-file.txt
$ curl -X PUT http://localhost:5000/upload -F "file=@my-file.txt"

{
  "url": "http://07cbecfea60c:5000/download/my-file.txt"
}

The file is available to download at /download/my-file.txt:

$ curl http://localhost:5000/download/my-file.txt

hello world

You can also save downloaded files to the file system my mounting /uploads from the container onto the host:

docker run -it -v -p 5000:5000 ghcr.io/andreasjansson/docker-file-upload-server:main

And in a new shell:

$ echo hello world > my-file.txt
$ curl -X PUT http://localhost:5000/upload -F "file=@my-file.txt"

{
  "url": "http://07cbecfea60c:5000/download/my-file.txt"
}

$ cat uploaded-files/my-file.txt

hello world

About

Simple file upload server for testing

License:MIT License


Languages

Language:Python 86.6%Language:Dockerfile 13.4%