I have a Windows user I want to share a large file with, they have Firefox with I understand supports resumable HTTP file downloads, and I have Ubuntu Linux, but limited disk space and such, so I don't want a full blown solution like Apache's web server.

I'd like to just run the server via the command line or GUI when I want, not on boot.

If I can avoid it, I don't want to edit a config file - I'd rather just give a command line argument for it's port, I'm used to using python -m SimpleHTTPServer - but I don't think it is resumable.

  • "share a ... file" - So... you want to transfer a file eh, and you don't want to use the FILE TRANSFER PROTOCOL why? – ta.speot.is Jul 7 '11 at 8:10
  • 2
    I don't find name-ism useful here, there is nothing wrong with wanting to use a browser to download a file especially since the end user is comfortable with it. Don't see what should be complex or problemabtic about running a resumable HTTP server, do you? – Luke Stanley Jul 7 '11 at 8:13
  • I have a partial answer I may post in ~6 hours (rep < 100): pastebin.com/DS0wedwk – Luke Stanley Jul 7 '11 at 9:36
  • @todda.speot.is: maybe because FTP is insecure and sends password across the network. – n0pe Jul 7 '11 at 13:08
  • 2
    Mainly it's because simplicity for end users is king. – Luke Stanley Jul 7 '11 at 21:07

Use thttpd.

thttpd -d /home/bob/sharedfolder -p 8080

The directory /home/bob/sharedfolder would become accessible at http://address:8080.

screenshot of thttpd directory listing in Chrome showing localhost on port 8080

lighttpd can be used in a similar way, although it needs a tiny config file. For example:

server.document-root = "/home/bob/sharedfolder"
server.port          = 8080
dir-listing.activate = "enable"

which is then ran like this:

lighttpd -f foo.conf
| improve this answer | |
  • Thanks grawity, I made some edits. Would appreciate some question upvotes. – Luke Stanley Jul 7 '11 at 21:22
  • even python -m SimpleHTTPServer 8000 should be enough ... :) – akira Jan 23 '12 at 18:19
  • @akira: SimpleHTTPServer does not support byte ranges, meaning it cannot resume interrupted transfers. Test with curl http://localhost:8000/testfile -o /dev/null -C 100, for example. – user1686 Jan 23 '12 at 18:21
  • This is exactly what I needed, using lighttpd now and it's working great. – Rob Jan 23 '12 at 18:38
  • @grawity: true. but that aside: might be a viable option. missing byte range: thats why i only put it aside your answer and not as a standalone answer. – akira Jan 24 '12 at 7:00

I recently created a python module, ext_http_server, that extends the functionality of the SimpleHTTPServermodule. One of its features is resumable file downloads, in addition to https, authentication and rate limiting.

Here's a direct link to the installation and usage instructions.

I should state that lighttpd contains all the same functionality so if you're looking for something production-ready go with lighttpd. If you're looking for using something in python that you can easily build-upon, check out ext_http_server.

| improve this answer | |
  • that sounds cool! – Luke Stanley Aug 29 '12 at 4:55
  • I actually used this for something but I didn't want rate limiting, https or user/pass, so it's a bit verbose to command for what I wanted: ext_http_server --cert /home/luke/Downloads/cert.pem -d . -p 9191 -a test:test -r 999999999999999 – Luke Stanley Oct 23 '12 at 7:56
  • The default executable in the package that is created is meant to have all of those features. With a little work you could build your own executable (script) that has only the resumable downloads. However, in that case, it'll probably be faster to use thttpd or lighttpd. – bboe Oct 23 '12 at 18:38
  • Yeah, it might be worth considering a simple mode, or as a simple mode as a default. Nice work though, of course. – Luke Stanley Oct 23 '12 at 22:11

Use Lighttpd - You're using Linux so I guess you're familiar with the drill! Place the file you want to share in the /var/www folder Modify the init.d conf file to remove Lighttpd from bootup daemons.

Lighttpd does all you want and more - And, its not small, its TINY! ;)

| improve this answer | |
  • Yeah I used Monkey already. Arbitrary difference perhaps. See: pastebin.com/DS0wedwk but I'm looking for a 0 config file solution if possible :) – Luke Stanley Jul 7 '11 at 9:35
  • lighttpd doesn't seem to support byte ranges if I download a file with curl I get: HTTP server doesn't seem to support byte ranges – Zibri Mar 2 '19 at 13:19

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.