A very neat trick to share files over a LAN.
In this scenario, computer B wants to make available files for A to download. A is the client, B is the server.
A LAN Local Area Network is what you typically have at home.
It's very simple to expose the files available in a folder:
python -m http.server 8888
Using the python interpreter installed on the machine and available in the path this will launch an HTTP server listening on port 8888.
After this point you may visit using a web browser http://localhost:8888 to see the files in the folder you launched the command from.
It's possible to download files from one computer to the other.
Using a similar logic it's possible to send files over HTTP to another computer.
git clone https://github.com/7omate/python-simple-upload
cd python-simple-upload pip install -r requirements.txt python pyup.py
This will run a webserver hosting a page that you can visit to upload files from a device connected on the same network.
The computer that could previously only download files is now capable of uploading files as well.Share on Twitter Share on Facebook