Skip to content

Amruthchief/file_transfer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 

Repository files navigation

TCP File Transfer Utility

A cross-platform C-based TCP file transfer utility that allows transferring files between networked computers.

Prerequisites

1. Install GCC Compiler

Ensure you have the GCC compiler installed.

  • Windows: Install MinGW-w64 or MSYS2.
  • Linux: sudo apt install build-essential
  • macOS: xcode-select --install

2. Install Make

make is used to automate the build process using the provided Makefile.

Windows

  • Using Chocolatey: choco install make
  • Using Winget: winget install GnuWin32.Make
  • Using MSYS2: pacman -S make
  • Manual: Download from GnuWin32 and add the bin folder to your System PATH.

Linux (Ubuntu/Debian)

sudo apt update
sudo apt install make

macOS

brew install make

Building the Project

Open your terminal in the project directory and run:

make all

This will generate two executables:

  • server.exe (or server on Linux/macOS)
  • client.exe (or client on Linux/macOS)

To clean the build files:

make clean

How to Use

The utility is configured to transfer a file named send.txt from the client to the server.

Step 1: Prepare the File

Ensure a file named send.txt exists in the same directory as the client executable.

Step 2: Start the Server

The server must be running and listening before the client connects.

./server

The server will listen on 127.0.0.1:8080 by default and save the received data to recv.txt.

Step 3: Run the Client

In a new terminal window, run:

./client

The client will connect to the server, send the contents of send.txt, and close the connection.


Configuration

Currently, the IP address and Port are hardcoded in server.c and client.c:

  • IP: 127.0.0.1
  • Port: 8080

To transfer files between different machines, update the ip variable in both files with the server's LAN IP address and recompile using make.

About

TCP file transfer utility that will allow us to transfer files between two networked computers.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors