Skip to content

Java Sockets Program with a client and a server. (Client sends files, server catches them and downloads on approval). Learned it from: "WittCode" on YouTube.

License

Notifications You must be signed in to change notification settings

yunusemrejr/Client-Server-File-Transfer-Java

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

FileSync - Modern File Transfer Application

A professional Java Swing client-server file transfer application with a modern dark-themed UI. Transfer files between machines over TCP sockets with real-time progress tracking, file previews, and transfer history.

Features

Client

  • Modern Dark UI with a professional color palette
  • Drag & Drop file support - drop files directly onto the window
  • File Browser with file info display (name, size, type)
  • Configurable Connection - set server host and port
  • Transfer Progress Bar with real-time status updates
  • Transfer History log with success/failure indicators
  • Threaded Transfers - UI stays responsive during file sends

Server

  • Modern Dark UI matching the client aesthetic
  • File Cards with type icons, size, sender info, and timestamps
  • File Preview - view text files and images directly in the app
  • Save File Dialog - choose where to save received files
  • Configurable Save Directory via the footer button
  • Threaded Networking - accepts multiple concurrent connections
  • Status Bar with live connection info and file count

Shared

  • TransferProtocol utility class with shared constants, color theme, file type detection, and formatting utilities
  • Enhanced MyFile model with timestamps, sender info, and formatted size display
  • Supports files up to 500 MB

How to Run

Compile

# Server
cd Server
javac TransferProtocol.java MyFile.java Server.java

# Client
cd Client
javac TransferProtocol.java Client.java

Start the Server

cd Server
java Server

The server will start listening on port 3039 by default.

Start the Client

cd Client
java Client

The client connects to localhost:3039 by default. You can change the host and port in the connection panel.

Transfer a File

  1. In the Client, either drag & drop a file onto the drop zone or click Browse Files
  2. Review the file info card showing name, size, and type
  3. Click Send File to transfer
  4. Watch the progress bar and check the transfer history
  5. On the Server, click any received file card to preview or save it

Architecture

Client (TCP) -----> Server (TCP listener)
  |                    |
  |-- FileInputStream  |-- DataInputStream
  |-- DataOutputStream |-- File preview/save
  |-- Progress UI      |-- File list UI

Requirements

  • Java 17 or later
  • No external dependencies - pure Java Swing

Color Theme

The application uses a modern Tokyo Night-inspired dark theme:

  • Background: #1E1E2E / #2A2A3C
  • Accent Blue: #7AA2F7
  • Accent Green: #9ECE6A
  • Accent Red: #F7768E
  • Text: #C0CAF5 / #A9B1D6

About

Java Sockets Program with a client and a server. (Client sends files, server catches them and downloads on approval). Learned it from: "WittCode" on YouTube.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages