Skip to content

Commit 204517f

Browse files
committed
Readme update, Use const instead of let
1 parent 92137aa commit 204517f

2 files changed

Lines changed: 4 additions & 3 deletions

File tree

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ corresponding environment variable will be ignored.
5454
| `--token` | `TOKEN` | An optional token which must be provided on upload. | Nothing |
5555
| `--path-regexp` | `PATH_REGEXP` | A regular expression to verify a given upload path. This should be set with care, because it may allow write access to outside the upload directory. | `/^[a-zA-Z0-9-_/]*$/` |
5656
| `--disable-auto-port` | `DISABLE_AUTO_PORT` | Disable automatic port increase if the port is nor available. | Not set. |
57+
| `--enable-folder-creation` | `ENABLE_FOLDER_CREATION` | Enable automatic folder creation when uploading file to non-existent folder. | Not set. |
5758
| `--help`, `-h` | | Show some help text | |
5859

5960
Examples:
@@ -62,7 +63,7 @@ PORT=9000 UPLOAD_DIR=~/uploads/ UPLOAD_TMP_DIR=/tmp/ TOKEN=my-super-secret-token
6263
6364
http-server-upload --port=9000 --upload-dir="c:\users\peter\Path With Whitespaces\"
6465
65-
PORT=9000 http-server-upload --disable-auto-port ./
66+
PORT=9000 http-server-upload --disable-auto-port --enable-folder-creation ./
6667
```
6768

6869

http-server-upload.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ Argument | Environmen variable
6363
--disable-auto-port | DISABLE_AUTO_PORT
6464
Disable automatic port increase if the port is nor available. [Not set]
6565
--enable-folder-creation | ENABLE_FOLDER_CREATION
66-
Enable automatic folder creation when uploading file to inexisting folder. [Not set]
66+
Enable automatic folder creation when uploading file to non-existent folder. [Not set]
6767
--help or -h
6868
Show this help text.
6969
@@ -193,7 +193,7 @@ server.on('request', (req, res) => {
193193
fields.path = '';
194194
}
195195

196-
let targetPath = path.join(uploadDir, fields.path);
196+
const targetPath = path.join(uploadDir, fields.path);
197197
fs.stat(targetPath, (err) => {
198198
if (err) {
199199
if (enableFolderCreation) {

0 commit comments

Comments
 (0)