A simple bash script to zip and share local files or folders using a temporary HTTP server and a public LocalTunnel URL. The script can also generate a QR code for easy mobile access.
- Share multiple files and folders over the internet
- Automatically zips content for easy download
- Uses
localtunnelfor public exposure (no port forwarding required) - Generates a downloadable link and optional QR code
- Opens everything in separate terminals to avoid bugs or conflicts
Screencast.from.06.06.2025.00.07.28.webm
| Tool | Purpose |
|---|---|
bash |
Run the script |
zip |
Archive files |
curl |
Download and shorten URLs |
python3 |
Host local HTTP server |
node, npm |
Required for localtunnel |
qrencode |
(Optional) Generate QR code |
gnome-terminal |
Open steps in new windows |
Clone this repo and enter the folder:
git clone https://github.com/4lp1ne/File_share
cd File_shareInstall required system packages:
sudo apt update
sudo apt install zip curl python3 npm gnome-terminalInstall LocalTunnel globally:
sudo npm install -g localtunnel(Optional) Install QR code generator:
sudo apt install qrencode./file_share.sh "file1.txt,folder2,video.mp4" 8080"file1.txt,folder2"— comma-separated list of files or folders8080— the local port for HTTP server (any free port)
-
Zips all specified files/folders into
transfert_pack.zip -
Starts a local HTTP server in a new terminal
-
Launches a LocalTunnel session in a separate terminal
-
Waits for public URL and builds a full download link
-
Saves and displays:
- 🔗 Final public URL (in
short_url.txt) - 📱 Optional QR code (as
short_url_qr.png)
- 🔗 Final public URL (in
-
Opens:
- LocalTunnel link in your browser
- QR code (if enabled) in an image viewer
📦 Zipping folder: folder2
📦 Creating final zip package: transfert_pack.zip
🚀 Starting HTTP server on port 8080 in new terminal...
☁ Starting localtunnel in new terminal...
✅ Public URL: https://abcde.loca.lt/transfert_pack.zip
📱 Generating QR code...
✅ Transfer ready!
wget <url> Remove temporary files:
rm transfert_pack.zip short_url.txt short_url_qr.png- Port already in use: Try a different port (e.g.
8090) - Missing terminal: Replace
gnome-terminalwithkonsole,xterm, etc., as needed. - Permission errors with npm: Use
sudoor fix npm permissions
MIT License
Copyright (c) 2025 4lp1ne_$ock3t
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.