python: simple http server for file sharing
May 15th, 2009 mysurface Posted in python | Hits: 236364 | 13 Comments »
You do not need to setup apache server just to hosting your file for sharing. If you have python 2.5 and above, you can do this at the targeted directory to share.
python -m SimpleHTTPServer 9914
9914 is the port number I choose to host my web, assume my IP is 192.168.1.1, in firefox you can ask your friend to access this url: http://192.168.1.1:9914.
It is easy isn’t it? You do NOT even need to run it as root, just run it as normal user but make sure your firewall allow the chosen port number.







May 15th, 2009 at 2:59 pm
If that don’t work take a look at a slightly different way to do the same thing.
May 15th, 2009 at 5:41 pm
So how to stop this http service once the supposed file download is completed?
May 15th, 2009 at 6:35 pm
I usually kill it by pressing control+c.
May 15th, 2009 at 8:33 pm
I like how you don\’t need to write a single line of code and that you can use the default behaviour of the HTTP module to host files.
June 20th, 2009 at 9:07 pm
Good instructions.. If you have more than one computer hooked up to a router, you would need to forward 9914 to the specific network IP of the computer that has the file you want to share. Still very easy stuff though..
Thanks
January 11th, 2010 at 9:46 pm
In Python 3.x it is:
python -m http.server 9914
March 11th, 2014 at 2:26 am
Everyone loves what you guys are up too. Such clever work and coverage!
Keep up the wonderful works guys I’ve incorporated you guys to my own blogroll.
Also visit my web page … hantu pocong
June 30th, 2014 at 10:57 am
liquid smoke recipes python: simple http server for file sharing » Linux by Examples
July 4th, 2014 at 2:12 pm
Tremendous things here. I’m very glad to see your post.
Thanks a lot and I’m having a look forward to contact you.
Will you please drop me a e-mail?
September 25th, 2014 at 9:20 am
Excellent blog here! Also your web site loads up fast!
What web host are you using? Can I get your affiliate link to
your host? I wish my site loaded up as fast as yours lol
October 5th, 2014 at 7:09 am
Howdy are using WordPress for your site platform? I’m
new to the blog world but I’m trying to get started and create my own. Do you need any coding expertise to make your
own blog? Any help would be greatly appreciated!
November 17th, 2014 at 2:01 pm
In addition to having a Web site to promote your business,
you have numerous internet marketing options, such as article marketing (writing articles and submitting
them to article directories), forum marketing (posting
on relevant forums), and affiliate marketing (having affiliates promote your product or service and, in return, they receive
a percentage of the sale price). A professional and experienced offshore software development
service provider can offer highly effective and proven business strategies to organizations struggling with their IT requirements that are required to enhance and
simplify their various business activities.
With 389,079 square metres, the building becomes the second-largest in the world, after
the Pentagon and the largest office building in China.
May 12th, 2015 at 7:42 am
in learning the how too’s of Linux computering, I have, several times, had to redo the entire system install.
having become almost fluent in Linux Exlicitives.
I look to erase the pain of playing with this wonderfull Operating System.
notably making MISTAKES daily; but learning!
simply put I want to install a computer that only serves my personal repository of linux software, stopping the day long task of re downloading it all again.
the concept is to have a network in place, no internet on it. with a wifi enabled fully usable computer, which has a primary task of serving the repository over the wifi LAN/WAN.
Dave