Raspberry Pi achieve with the host to transfer files via SimpleHTTPServer

By default, our Raspberry Pi has a python 2.7 version is installed. python2 default contains SimpleHTTPServer this library. So we can be directly used to use.

We can see from the name, he is a http server. Since it is http server, then we can use to be used as a file download service, indirect complete copy of the file.

We can start an http service by the following command:

~ $ python -m SimpleHTTPServer 8088
Serving HTTP on 0.0.0.0 port 8088 ...
...

If you want to use port 80 (make sure not Fengdiao operators), set 8088 into 80 sudo python -m SimpleHTTPServer 80.

After a good start we can in the browser by opening  http://<your ip or domain>:8088 to access all files start at that location when the service this way.

If you want to copy files from the Raspberry Pi to a local, then start the service in the Raspberry Pi, if you want a local copy files to the Raspberry Pi, start the service in our local.

caveat! ! ! Used with caution, because the application is interrupted me, you would not be able to find the IP. Adjourned to be solved.

 

 

Reference Links: https://www.jianshu.com/p/b6570289a08e

Guess you like

Origin www.cnblogs.com/lfri/p/11874834.html