sgreben / http-file-server

tiny portable HTTP file server. single binary, no dependencies. linux, osx, windows. #golang
MIT License
214 stars 40 forks source link

Add example for uploading files using curl #2

Closed Mindavi closed 4 years ago

Mindavi commented 4 years ago

Because this was not as straightforward as I thought it was, I think it would be good to add this to the README.

How to upload files using curl:

./http-file-server -uploads /=/path/to/serve
curl -F "file=@example.txt" localhost:8080/path/to/upload/to

Alternatively, you could support the --upload-file function of curl, which does a PUT request to the new path for the file.

sgreben commented 4 years ago

Thank you! I've added this one in https://github.com/sgreben/http-file-server/releases/tag/1.5.2 :)