There are a variety of times I need to send files over the network and the proper infrastructure to do so is lacking (not my network, thank you very much!). The good news is you can send files using HTTP around the network with just a simple command.

  • cd directory-you-want-to-share && python -m SimpleHTTPServer

This should run on any sane operating system (Linux, Mac OS X etc). To run it on Windows, make sure python is installed (Google it if not) and run:

  • dir directory-you-want-to-share
  • python -m SimpleHTTPServer

Then, just navigate with any browser on the network to [Your computers IP address]:8000 (for example, 192.168.0.3:8000) and you should have a directory list.

File transfers are generally quite slow for HTTP downloads so it isn’t the most effective transfer method ever used; however, when you need some files transfered and you have no SMB/CIIFS, NFS or SFTP then this is the bad boy to call upon.

If we haven't bored you, here is some more:

  1. Eureka Streams: A social network client from Lockheed Martin.

Stevie Holdway

Stevie - the self-confessed third-wheel of Game-Engine - is a writer, comedian, technologist and (amateur) performer. One of the newest members of the team, he has always had a long standing interest in computers and the law and philosophy that surrounds them. He does his best to present his passion in a semi-entertaining way which often fails miserably. Stevie is a fan of irony and awkward situations and, yes, that is a bit of flesh showing on his picture... ladies...

  3 Responses to “Send files over a network with Python’s SimpleHTTPServer”

  1. [...] This post was mentioned on Twitter by Game Engine, Python UK. Python UK said: Send files over a network with Python's SimpleHTTPServer | Game Engine http://bit.ly/bcrd9s [...]

  2. I’m trying to figure out how to open the port on osx (leopard), so that computers on a local network can reach the server. I can not get it to work.

    It looks like you figured this out. How did you manage to do this?

  3. I didn’t write the article with OS X in mind but I suggest going to Preferences > Security > Firewall to open your ports. If you are wondering what ports to open, it should be port 80.
    I’m not on an OS X computer at the moment so I’m afraid my help may be rather limited. :(

 Leave a Reply

(required)

(required)

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

   
© 2012 Game Engine Being Clever about being Dumb since 1858 Suffusion theme by Sayontan Sinha