This is a simple zero-configuration command-line http server which provides a lightweight interface to upload files.
By default files are uploaded to the current working directory.
Optionally a token may be used to protect against unauthorized uploads.
npm install --global http-server-upload
This will install
http-server-upload globally so that it may be tun from the command line.
[uploadRootPath] defaults to the current working directory (
Other options can be set using environment variables.
When the server is running you can visit http://localhost:8080/ to get the upload form.
Attention: Already existing files will be overwritten on upload.
||The port to use.||
||The directory where the files should be uploaded to. This overrides the
||Temp directory for the file upload.||The upload directory.|
||An optional token which must be provided on upload.||Nothing|
||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.||
PORT=9000 UPLOAD_DIR=~/uploads/ UPLOAD_TMP_DIR=/tmp/ TOKEN=my-super-secret-token http-server-upload
Uploads from the command line
http-server-upload is running, you may also upload files from the command line using
curl -F "firstname.lastname@example.org" http://localhost:8080/upload
Advanced example with multiple files, an upload path and a required token:
curl \ -F "email@example.com" \ -F "firstname.lastname@example.org" \ -F "path=my/dir" \ -F "token=my-super-secret-token" \ http://localhost:8080/upload