SimpleHTTPServer File Transfers

Another student walked up to me earlier today, asking for my help in getting some files off a thumb drive and onto an Ubuntu virtual machine running on Windows

We tried to

  • connect the thumb drive to the VM
  • send the files via email

Neither worked - the VM refused to connect to the drive and Firefox in the VM refused to render Gmail properly

My solution?

I plugged his drive into my Macbook, cd'ed to /Volumes/UNTITLED and ran

$ python -m SimpleHTTPServer

I then opened IP:8000 on his computer and downloaded the files via his web browser.

You can reduce the amount of typing required by creating an alias:

$ alias server = "python -m SimpleHTTPServer"
$ server
Serving HTTP on port 8000 ...        

Quickly running an HTTP server is faster than pulling out a flash drive, transferring the files onto it, giving it to another person, and having them copy it to their computer.