1.1.1 • Published 1 year ago
upload-server-lite v1.1.1
upload-server-lite
Minimal web server to accept file upload over the network
Installation
# install as dev dependency
npm i -D upload-server-lite
# or install as global package
npm i -g upload-server-lite
Usage
Start the server:
> npx upload-server-lite
listening on http://127.0.0.1:8100 (lo)
listening on http://192.168.1.3:8100 (wlp3s0)
Upload from client:
If the GUI is available, you use a web browser to upload files through the url printed form the server cli.
If GUI us not available, you can upload with curl
:
For example:
> curl -F file=@package.json http://192.168.1.3:8100
{
"file": {
"size": 443,
"filepath": "/path_of_cwd/uploads/package.json",
"newFilename": "package.json",
"mimetype": "application/octet-stream",
"mtime": "2022-04-24T08:17:22.199Z",
"originalFilename": "package.json"
}
}
Server Options
Format: npx upload-server-lite [port] [maxFileSize]
To specify port:
npx upload-server-lite 8080
To specify maxFileSize:
npx upload-server-lite 200K
To specify port and maxFileSize:
npx upload-server-lite 8080 10M
npx upload-server-lite 2G 8080
License
This project is licensed with BSD-2-Clause
This is free, libre, and open-source software. It comes down to four essential freedoms [ref]:
- The freedom to run the program as you wish, for any purpose
- The freedom to study how the program works, and change it so it does your computing as you wish
- The freedom to redistribute copies so you can help others
- The freedom to distribute copies of your modified versions to others