Skip to content

Commit 6e51b46

Browse files
committed
Release v3.0.0
* 💥 Require Node.js >= 14.18 * 💥 Added correct http status codes for error responses * Added option to serve a custom index html file * Fixed false upload ok message when no file was uploaded * Updated formidable dependency * Refactored and optimized some code parts * Switched to ES module style * Added eslint checks for better code
1 parent 53051d1 commit 6e51b46

2 files changed

Lines changed: 11 additions & 8 deletions

File tree

CHANGELOG.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
# Changelog
22

3-
## v3.0.0 (WIP)
3+
## v3.0.0 (2023-09-11)
44

55
* 💥 Require Node.js >= 14.18
6-
* Added correct http status codes for error responses
6+
* 💥 Added correct http status codes for error responses
77
* Added option to serve a custom index html file
88
* Fixed false upload ok message when no file was uploaded
99
* Updated formidable dependency

README.md

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ By default files are uploaded to the current working directory.
1111

1212
Optionally a token may be used to protect against unauthorized uploads.
1313

14-
1514
## Installation
1615

1716
Version 3 of `http-server-upload` requires Node.js 14.18 or higher.
@@ -22,7 +21,6 @@ npm install --global http-server-upload
2221

2322
This will install `http-server-upload` globally so that it may be run from the command line.
2423

25-
2624
## Usage
2725

2826
```sh
@@ -40,7 +38,6 @@ until the next free port is found. This can be disabled, see below.
4038

4139
*Attention:* Already existing files will be overwritten on upload.
4240

43-
4441
### Arguments and environment variables
4542

4643
The optional configuration is done by command line arguments or environment variables.
@@ -61,6 +58,7 @@ corresponding environment variable will be ignored.
6158
| `--help`, `-h` | | Show some help text | |
6259

6360
Examples:
61+
6462
```sh
6563
PORT=9000 UPLOAD_DIR=~/uploads/ UPLOAD_TMP_DIR=/tmp/ TOKEN=my-super-secret-token http-server-upload
6664

@@ -69,15 +67,16 @@ http-server-upload --port=9000 --upload-dir="c:\users\peter\Path With Whitespace
6967
PORT=9000 http-server-upload --disable-auto-port --enable-folder-creation ./
7068
```
7169
72-
7370
### Uploads from the command line
7471
7572
If the `http-server-upload` is running, you may also upload files from the command line using `curl`:
73+
7674
```sh
7775
curl -F "uploads=@my-file.txt" http://localhost:8080/upload
7876
```
7977
8078
Advanced example with multiple files, an upload path and a required token:
79+
8180
```sh
8281
curl \
8382
-F "uploads=@my-file.txt" \
@@ -88,14 +87,18 @@ curl \
8887
```
8988
9089
Example for uploading content from a pipe:
90+
9191
```sh
92-
cat my-file.dat | curl -F "uploads=@-;filename=my-file.dat;type=application/octet-stream" http://localhost:8080/upload
92+
cat my-file.dat \
93+
| curl -F "uploads=@-;filename=my-file.dat;type=application/octet-stream" \
94+
http://localhost:8080/upload
9395
```
96+
9497
Notice the required `filename` and `type` defintions for uploading piped data.
9598
The `type` is the mime type of the data to upload.
9699
97100
## License
98101
99102
MIT license
100103
101-
Copyright (c) 2019-2023 Peter Müller <peter@crycode.de> https://crycode.de
104+
Copyright (c) 2019-2023 Peter Müller <peter@crycode.de> <https://crycode.de>

0 commit comments

Comments
 (0)