LocalShare is a web-based file sharing and clipboard synchronization application designed for local network use. It allows users to easily share files and clipboard content between devices on the same network.
- File Upload: Drag & drop or select files to upload to the server
- File Download: Access and download files from a shared directory
- Clipboard Sharing:
- Text sharing across devices
- Image sharing support
- Server clipboard synchronization
- Responsive Design: Works on desktop and mobile devices
- Real-time Updates: Instant feedback on operations
- Network Accessible: Available to all devices on the local network
- Python 3.x
- Flask >= 2.0.0
- Werkzeug >= 2.0.0
- pyperclip >= 1.8.2
- Clone or download this repository
- Install the required dependencies:
pip install -r requirements.txt
LocalShare/
├── app.py # Main Flask application
├── requirements.txt # Python dependencies
├── data/ # Directory for shared files
├── static/ # Static assets
│ └── css/
│ └── styles.css # Application styling
├── templates/ # HTML templates
│ └── index.html # Main application interface
└── uploads/ # Upload directory
└── clipboard/ # Clipboard content storage
-
Start the server:
python app.py
-
The application will display the local IP address and port (default: 5000)
http://<your-local-ip>:5000 -
Access the web interface from any device on the same network using the provided URL
- Upload files through drag & drop or file selection
- Files are securely saved with sanitized filenames
- Download files from the shared data directory
- Support for multiple file uploads
- Maximum upload size: 1GB (configurable)
-
Text Sharing:
- Paste text content directly into the interface
- Synchronize with server clipboard
- View and copy shared text content
-
Image Sharing:
- Paste images directly from clipboard
- Supports common image formats (PNG, JPEG, GIF, BMP, WEBP)
- Preview images before sharing
- Filename sanitization
- Path traversal protection
- Upload size limits
- MIME type validation for images
- Random secret key generation for sessions
The following settings can be modified in app.py:
UPLOAD_FOLDER: Directory for uploaded filesDATA_FOLDER: Directory for downloadable filesCLIPBOARD_FOLDER: Directory for clipboard contentMAX_CONTENT_LENGTH: Maximum upload size (default: 1GB)
- Debug mode is enabled by default (
debug=True) - Comprehensive logging system included
- Error handling for all operations
- Modular design for easy extension
For production deployment, it's recommended to:
- Disable debug mode
- Use a production-ready WSGI server (e.g., Waitress or Gunicorn)
- Configure appropriate security settings
- Set up proper file permissions
Example using Waitress:
from waitress import serve
serve(app, host='0.0.0.0', port=5000)