9

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.

11
  • "share a ... file" - So... you want to transfer a file eh, and you don't want to use the FILE TRANSFER PROTOCOL why? Jul 7, 2011 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? Jul 7, 2011 at 8:13
  • I have a partial answer I may post in ~6 hours (rep < 100): pastebin.com/DS0wedwk Jul 7, 2011 at 9:36
  • @todda.speot.is: maybe because FTP is insecure and sends password across the network.
    – nopcorn
    Jul 7, 2011 at 13:08
  • 2
    Mainly it's because simplicity for end users is king. Jul 7, 2011 at 21:07

3 Answers 3

15

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
5
  • Thanks grawity, I made some edits. Would appreciate some question upvotes. Jul 7, 2011 at 21:22
  • even python -m SimpleHTTPServer 8000 should be enough ... :)
    – akira
    Jan 23, 2012 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. Jan 23, 2012 at 18:21
  • This is exactly what I needed, using lighttpd now and it's working great.
    – Rob
    Jan 23, 2012 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, 2012 at 7:00
4

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.

4
  • that sounds cool! Aug 29, 2012 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 Oct 23, 2012 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, 2012 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. Oct 23, 2012 at 22:11
2

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! ;)

2
  • Yeah I used Monkey already. Arbitrary difference perhaps. See: pastebin.com/DS0wedwk but I'm looking for a 0 config file solution if possible :) Jul 7, 2011 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, 2019 at 13:19

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .