From 9cd60561e2e05ec0f85d6d2c5b4e1fdb2f6ad9a3 Mon Sep 17 00:00:00 2001 From: Leon Richardt Date: Thu, 29 Oct 2020 10:11:57 +0100 Subject: [PATCH] doc: add usage instructions to README --- README.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/README.md b/README.md index 0ca3819..72a9e94 100644 --- a/README.md +++ b/README.md @@ -52,6 +52,16 @@ jaf -configFile example.conf ``` Of course, you can also write a init system script to handle this for you. +## Usage +You can use jaf with any application that can send POST requests (e.g. ShareX/ShareNix or just `curl`). +Make sure the file you want to upload is attached as a `multipart/form-data` field named `file`. +In `curl`, a request to upload the file `/home/alice/foo.txt` could look like this: +```bash +curl -L -F "file=@/home/alice/foo.txt" jaf.example.com/upload +``` +The response will include a link to the newly uploaded content. +Note that you may have to add additional header fields to the request, e.g. if you have basic authentication enabled. + ## Inspiration - [i](https://github.com/fourtf/i) by [fourtf](https://github.com/fourtf) – a project very similar in scope and size - [filehost](https://github.com/nuuls/filehost) by [nuuls](https://github.com/nuuls) – a more integrated, fully-fledged solution that offers a web interface and also serves the files