What Is FTP? A Simple Guide to File Transfer Protocol

02 Mins

Ever needed to upload a file to a server or download a large file from one? That’s where FTP (File Transfer Protocol) comes in. It is one of the oldest yet still widely used methods for transferring files over the Internet.

What Is FTP?

FTP (File Transfer Protocol) is a standard protocol used to transfer files between a client and a server over a network.

  • The client initiates the connection and requests uploads/downloads.
  • The server provides access to a file system where files can be stored or retrieved.

How FTP Works

FTP uses two separate TCP connections -

  1. Control Connection (Port 21) - Used for sending commands and receiving responses (e.g., USERPASSRETRSTOR). It remains open throughout the session.
  2. Data Connection (Port 20 or dynamically assigned) - Used for actual file transfer. It is opened and closed for each file sent/received.

FTP Modes: Active vs Passive

Active Mode

  • The client opens a port and waits for the server to establish the data connection.
  • This can cause issues if the client is behind a firewall or NAT, as incoming connections may be blocked.

Passive Mode (PASV)

  • The server opens a port, and the client initiates both connections.
  • More compatible with firewalls and NAT setups — making it the default mode for most clients today.

Is FTP Secure?

Classic FTP is not secure, it sends everything in plain text (including your username, password, and file contents). To solve this, developers now prefer secure alternatives that feel familiar to FTP but offer encryption built-in -

FTPS (FTP Secure) - Adds SSL/TLS encryption to traditional FTP and is ideal when working with legacy systems or hosting providers that still support FTP.

SFTP (SSH File Transfer Protocol) - It is built on top of SSH protocol, using port 22. It allows file transfers, directory traversal, permission management, and more - all over a secure connection.


Conclusion

FTP laid the foundation for transferring files across networks and is still found in many legacy systems today. However, SFTP provide encrypted communication while offering familiar file transfer capabilities. In the next article, we’ll explore SSH, the protocol that powers SFTP.