Skip to main content

A simple, multithreaded HTTP file server supporting resumable downloads and file uploads written in pure Python. Drop-in replacement for `SimpleHTTPServer`, `http.server`.

Project description

Resumable File Server

A simple, multithreaded HTTP file server supporting resumable downloads and file uploads written in pure Python. Drop-in replacement for SimpleHTTPServer, http.server.

Features

  • Supports Python 2 and Python 3
  • Proper handling of Unicode
  • Support for HTTP Range requests (partial downloads)
  • Multithreaded serving (handles many clients)
  • Directory browsing and file upload via UTF-8 HTML interface
  • Specify root directory to serve files from
  • Configurable host/IP and port

Usage

Serve files inside /home/user on localhost:8080:

python -m resumable_file_server 8080 --host localhost --port  --root /home/user/

Then download with curl:

curl -O -C - http://localhost:8080/largefile.zip

You can also upload a file (this uploads it to /home/user/images/):

curl -X POST -F "file=@/path/to/photo.jpg" http://localhost:8080/images/

And you will see an UTF-8 HTML with a file picker and upload button at the bottom if you open http://localhost:8080/ with your browser.

Arguments

Argument Description Default
port Port to listen on 8000
--host Host/IP address to bind to localhost
--root, -r Root directory to serve files from . (current directory)

Security Notes

  • Requests outside the root directory (e.g., ../../etc/passwd) are blocked automatically.
  • Only files inside the --root are accessible.

License

MIT License

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

resumable_file_server-0.1.0a1.tar.gz (6.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

resumable_file_server-0.1.0a1-py2.py3-none-any.whl (6.7 kB view details)

Uploaded Python 2Python 3

File details

Details for the file resumable_file_server-0.1.0a1.tar.gz.

File metadata

  • Download URL: resumable_file_server-0.1.0a1.tar.gz
  • Upload date:
  • Size: 6.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.2

File hashes

Hashes for resumable_file_server-0.1.0a1.tar.gz
Algorithm Hash digest
SHA256 121120415ea9456254173e9cd74f562791ddbae1d81a16bd11b71618ef53c46b
MD5 50a48206448d6bb1eefdb752d4aefa57
BLAKE2b-256 18b3ac181c18b93163bd880fa1b32866e6258960ea6ed541bf8989b478c11e03

See more details on using hashes here.

File details

Details for the file resumable_file_server-0.1.0a1-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for resumable_file_server-0.1.0a1-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 81ff13fd03f1a628205fa1e62cdadd7b64f9bdc5795db06392b73cc90c511479
MD5 b1998f86fedc49a430ff88fc082e3c49
BLAKE2b-256 c1dc192c6adcb6c8bc3d23936d3fc033a9c6b86030da3c9449939852b22cb6aa

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page