This Python script allows you to share files or folders over your local network using an HTTP server. It also generates a QR code for convenient access to the shared resource.
- Python 3.6 or newer
qrencode
(Install usingsudo apt install qrencode
on Ubuntu/Debian-based systems)
- Clone this repository or copy the script to your local machine.
- Ensure you have Python 3 installed.
- Install
qrencode
if not already installed:sudo apt install qrencode
Run the script using Python with the desired file or folder path as an argument.
To share a file or folder:
python3 share.py /path/to/file_or_folder
You can specify a custom port with the -p
or --port
option:
python3 share.py /path/to/file_or_folder -p 8080
- The script will output a URL (e.g.,
http://192.168.1.100:3000/
) and display a QR code. - Open the URL in a web browser on any device connected to the same network.
- Alternatively, scan the QR code with your smartphone to access the resource.
Add the following alias at the end of the file:
alias myscript="python3 ~/.scripts/share.py"