### Start uploadserver Source: https://pypi.org/project/uploadserver/6.0.3 Starts the server using the default configuration. ```bash python3 -m uploadserver ``` -------------------------------- ### Install uploadserver via pip Source: https://pypi.org/project/uploadserver/6.0.3 Use this command to install the package for the current user. ```bash python3 -m pip install --user uploadserver ``` -------------------------------- ### Uploadserver CLI Usage Source: https://pypi.org/project/uploadserver/6.0.3 Displays the command-line interface help and available configuration options for the uploadserver. ```text usage: __main__.py [-h] [--cgi] [--allow-replace] [--bind ADDRESS] [--directory DIRECTORY] [--theme {light,auto,dark}] [--server-certificate SERVER_CERTIFICATE] [--client-certificate CLIENT_CERTIFICATE] [--basic-auth BASIC_AUTH] [--basic-auth-upload BASIC_AUTH_UPLOAD] [port] positional arguments: port Specify alternate port [default: 8000] options: -h, --help show this help message and exit --cgi Run as CGI Server --allow-replace Replace existing file if uploaded file has the same name. Auto rename by default. --bind, -b ADDRESS Specify alternate bind address [default: all interfaces] --directory, -d DIRECTORY Specify alternative directory [default:current directory] --theme {light,auto,dark} Specify a light or dark theme for the upload page [default: auto] --server-certificate, --certificate, -c SERVER_CERTIFICATE Specify HTTPS server certificate to use [default: none] --client-certificate CLIENT_CERTIFICATE Specify HTTPS client certificate to accept for mutual TLS [default: none] --basic-auth BASIC_AUTH Specify user:pass for basic authentication (downloads and uploads) --basic-auth-upload BASIC_AUTH_UPLOAD Specify user:pass for basic authentication (uploads only) ``` -------------------------------- ### Configure Basic Authentication Source: https://pypi.org/project/uploadserver/6.0.3 Enables basic authentication for both downloads and uploads. ```bash python3 -m uploadserver --basic-auth hello:world ``` -------------------------------- ### Configure Basic Authentication Source: https://pypi.org/project/uploadserver Enables authentication for all server operations or specifically for upload operations. ```bash python3 -m uploadserver --basic-auth hello:world ``` ```bash curl -X POST http://127.0.0.1:8000/upload -F 'files=@basicauth-example.txt' -u hello:world ``` ```bash python3 -m uploadserver --basic-auth-upload hello:world ``` -------------------------------- ### Set UI Theme Source: https://pypi.org/project/uploadserver/6.0.3 Enforces a specific light or dark theme for the upload page. ```bash python3 -m uploadserver --theme light ``` ```bash python3 -m uploadserver --theme dark ``` -------------------------------- ### Run uploadserver with HTTPS and Client Authentication Source: https://pypi.org/project/uploadserver/6.0.3 Enables mTLS by requiring a client certificate for secure file uploads. ```bash # Generate self-signed server certificate openssl req -x509 -out server.pem -keyout server.pem -newkey rsa:2048 -nodes -sha256 -subj '/CN=server' # Generate self-signed client certificate openssl req -x509 -out client.pem -keyout client.pem -newkey rsa:2048 -nodes -sha256 -subj '/CN=client' # Extract public key from self-signed client certificate openssl x509 -in client.pem -out client.crt # The server root should not contain the certificates, for security reasons cd server-root python3 -m uploadserver --server-certificate server.pem --client-certificate client.crt # Connect as a client curl -X POST https://localhost:8000/upload --insecure --cert client.pem -F files=@mtls-example.txt ``` -------------------------------- ### Run uploadserver with HTTPS Source: https://pypi.org/project/uploadserver/6.0.3 Configures the server with a self-signed certificate for encrypted communication without client verification. ```bash # Generate self-signed server certificate openssl req -x509 -out server.pem -keyout server.pem -newkey rsa:2048 -nodes -sha256 -subj '/CN=server' # The server root should not contain the certificate, for security reasons cd server-root python3 -m uploadserver --server-certificate server.pem # Connect as a client curl -X POST https://localhost:8000/upload --insecure -F files=@simple-example.txt ``` -------------------------------- ### Upload with Basic Authentication via cURL Source: https://pypi.org/project/uploadserver/6.0.3 Performs an authenticated file upload using cURL. ```bash curl -X POST http://127.0.0.1:8000/upload -F 'files=@basicauth-example.txt' -u hello:world ``` -------------------------------- ### Upload files via cURL Source: https://pypi.org/project/uploadserver/6.0.3 Uploads multiple files to the server using a POST request. ```bash curl -X POST http://127.0.0.1:8000/upload -F 'files=@multiple-example-1.txt' -F 'files=@multiple-example-2.txt' ``` -------------------------------- ### Configure Upload-only Basic Authentication Source: https://pypi.org/project/uploadserver/6.0.3 Restricts authentication requirements to upload operations only. ```bash python3 -m uploadserver --basic-auth-upload hello:world ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.