Skip to content

About

If you by any chance need to send files with python on local network - there you go.

Resources

Stars

2 stars

Watchers

0 watching

Forks

Latest commit

 

History

2 Commits

Folders and files

Repository files navigation

Quick LAN Python File Sharer

Python Kivy Plyer Pyfiglet

A simple, cross-platform desktop application built with Kivy for quick and easy file sharing between devices on the same local network. This tool allows you to send and receive files with a minimalistic user interface.

🌟 Features

  • Automatic Local IP Detection: Automatically finds and displays your local IP address (primarily 192.168.x.x range, preferring non-VPN interfaces).
  • Sender and Receiver Modes: Easily switch between sending files to another device or listening for incoming files.
  • Drag-and-Drop Sending: Quickly send files by dragging them directly onto the application window.
  • Multiple File Selection: Select multiple files at once to send them in sequence.
  • File Transfer Progress Bar: Visual feedback on the progress of file transfers.
  • Automatic Filename Handling: If a received file has the same name as an existing file, it will be saved with a numerical suffix (e.g., file_1.txt, file_2.txt).
  • Persistent Configuration: Remembers your last used recipient IP address and save folder.
  • Open Save Folder: Convenient button to directly open the chosen save directory.
  • Cross-Platform: Designed to work on Windows, macOS, and Linux.

📸 Screenshots

Main window

🚀 Installation

Prerequisites

  • Python 3.7+

Steps

  1. Clone the repository:

    git clone https://github.com/satifiedx/file_sharing.git
    cd quick-file-sharer
  2. Create a virtual environment (recommended):

    python -m venv venv
    # On Windows
    venv\Scripts\activate
    # On macOS/Linux
    source venv/bin/activate
  3. Install dependencies:

    The application relies on Kivy for the GUI and plyer for native file dialogs.

    pip install -r requirements.txt

    or manually

    pip install kivy plyer pyfiglet

🛠️ Usage

  1. Start the application:

    python sender_main.py
  2. Identify your Local IP: Your local IP address will be automatically detected and displayed in the "This computer's IP address" field. This is the IP you will share with others to receive files, or the IP you will enter in another instance of the app to send files to this one.

  3. To Receive Files:

    • Choose a Save Folder: Click "Choose save folder..." and select a directory where incoming files will be saved. You can also click "Open folder" to quickly access it.
    • Become a Receiver: Click the "I am Receiver" button. The button will change to "Stop Receiving" and the status will show "Server is running. Waiting for files...". Your app is now ready to receive files.
    • Stop Receiving: Click "Stop Receiving" to shut down the server.
  4. To Send Files:

    • Enter Recipient IP: In the "Recipient IP address" field, enter the IP address of the computer that is set up as a receiver (their "This computer's IP address").
    • Choose Files: Click the "Send File(s)" button to open a file browser and select one or more files.
    • Drag and Drop: Alternatively, simply drag files from your file explorer directly onto the application window to initiate sending.
    • The app will show the progress of each file transfer.

⚙️ How It Works (Technical Details)

The application uses standard TCP sockets for file transfers.

  • Receiver Mode: The application acts as a server, binding to 0.0.0.0 (all available network interfaces) on PORT 65432. It listens for incoming connections. When a connection is established, it first receives 4 bytes indicating the length of the metadata, then the metadata itself (filename and filesize, separated by |), and finally the raw file data in chunks.
  • Sender Mode: The application acts as a client, connecting to the specified recipient IP address on PORT 65432. It sends the metadata length, then the metadata (filename and filesize), and then streams the file's binary data.
  • IP Detection: The get_local_ip function attempts to find a local IP address (specifically in the 192.168.x.x range) by parsing ipconfig (Windows) or ip addr show/ifconfig (Linux/macOS) output. It tries to filter out VPN-related interfaces for a more reliable local network IP.

📦 Dependencies

  • kivy
  • plyer (optional, but highly recommended for native file dialogs)
  • pyfiglet for banner

🤝 Contributing

Contributions are welcome! If you have suggestions for improvements, bug reports, or want to add new features, please feel free to:

  1. Fork the repository.
  2. Create a new branch (git checkout -b feature/your-feature).
  3. Make your changes.
  4. Commit your changes (git commit -m 'Add new feature').
  5. Push to the branch (git push origin feature/your-feature).
  6. Open a Pull Request.

About

If you by any chance need to send files with python on local network - there you go.

Resources

Stars

2 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages