SERVEFILE(1) | User Commands | SERVEFILE(1) |
servefile - small HTTP-Server for temporary file transfer
servefile [-h] [--version] [-p PORT] [-u] [-s MAX_UPLOAD_SIZE] [-l]
Do not use this as a normal web server. This server is optimized for running a short time and to send files to other people, not for doing high-performance static file serving.
Servefile is a small HTTP-server intended for temporary file transfer mostly in the local network. It aims to make transferring single files as painless as possible and to replace tar/netcat solutions.
With just a file as argument servefile serves just that one file and redirects all HTTP requests to that file.
Uploads can be done with curl, wget (see EXAMPLES) or a normal browser. In upload mode with -u servefile creates a directory and saves all uploaded files into that directory. When uploading with curl or wget the filename is extracted from the path part of the url used for the upload.
For SSL support python-openssl (pyssl) needs to be installed. If no key and cert is given, servefile will generate a key pair for you and display its fingerprint.
In --tar mode the given file or directory will be packed on (each) request and piped to the client through the HTTP connection, thus serving always the latest content of the directory and preventing temporary file creaton. Tar files will be created containing only the lowest directory name from the full path, so using /path/to/dir/ as file/directory argument will create a tar file starting with the dir/ directory. When giving a file as argument, only the file without any path will be in the tarfile. Symlinks will not be dereferenced.
Serving a single file with SSL and HTTP Basic auth:
Enabling uploads to a directory:
Uploading file foo as bar to servefile via command line:
curl -X PUT http://ip:port/bar --data-binary @foo
curl -X POST http://ip:port/bar --data-binary @foo
wget http://ip:port/bar --post-file=foo
Serving a on the fly generated tar.gz file of a directory:
servefile is developed by Sebastian Lohff <seba@someserver.de>
November 2015 | servefile 0.4.4 |