Simple file upload server in Rust
902
Simple webserver that allows uploading files to a specified directory.
You need to set the following environment variables:
FILE_DIRECTORY - Where to save the filesBASE_URL - The url where files are served fromSERVER_PORT - The port to listen onUPLOAD_TOKEN - A value that must be passed in the token header to allow uploadingFILE_DIRECTORY=/tmp/uploader BASE_URL=https://domain.com/files/ SERVER_PORT=5000 UPLOAD_TOKEN=1234567 uploadserver
# Or with Docker
docker run --rm -ti -p 5000:5000 -e FILE_DIRECTORY=/tmp/uploader -e SERVER_PORT=5000 -e BASE_URL=https://domain.com/files/ -e UPLOAD_TOKEN=1234567 -v /host/path:/tmp/uploader uploadserver:latest
Upload a file using a multi-part form field with a field name of file. You also need to set two values in the HTTP header:
token - This must match the UPLOAD_TOKEN environment variable specified when starting the serveruploadpath - The relative path to upload the given file to
FILE_DIRECTORY environment variable set on the serveruploadpath value must include the filename (e.g. relative/path/to/file.txt)Content type
Image
Digest
Size
28.2 MB
Last updated
about 6 years ago
docker pull ezzizzle/uploadserver