Page 1 of 1

Easy home network share

Posted: Wed May 10, 2023 8:32 pm
by d-pupp

@dimkr

But my point is, you don't need Samba to transfer files in the LAN!!! You can use python3 -m http.server 80

I tried this... It is really cool and simple
All you have to do is open the folder you want to share. Open a terminal here (on the folder you want to share) or Open a terminal and cd to the folder you want to share. And type

Code: Select all

python3 -m http.server 8080

And it starts a minimal web server. get files only no uploads.

Leave the terminal running! Once you shut the terminal or ctrl c the server stops.

Now you need your local ip address

Code: Select all

ip a

or

Code: Select all

ifconfig

will get you what you need.

Now open your browser either remotely or locally and type into the address bar the ip address a : and port number you used above. ie. 192.168.0.10:8080

That it. your browser will display anything in the folder
You can even test web pages by naming it index.html and it will open like a normal web page
P.S. Files with a .txt extension open up and display it contents if you want to download it rename it without the .txt

P.S. I am not sure if this will work in all pups. It does work in Vanilla dpup
to test type

Code: Select all

which python3

if you get a response you are good to go. :thumbup:


Re: Easy home network share

Posted: Thu May 11, 2023 12:29 pm
by fredx181
d-pupp wrote:

python3 -m http.server 8080

And it starts a minimal web server. get files only no uploads.

For python3 with upload, see here: viewtopic.php?p=82147#p82147

To get easily your local ip-address:
ip addr show | grep -w "inet" | grep -v "127.0.0.1" | awk '{print $2}' | cut -d "/" -f 1