DEV Community

Cover image for Getting Files from Point A to B: A Developer’s Guide to FTP
Athreya aka Maneshwar
Athreya aka Maneshwar

Posted on

4 2 2 2 2

Getting Files from Point A to B: A Developer’s Guide to FTP

Let’s talk about the OG of file transfer tools — FTP, or File Transfer Protocol.

Before cloud syncs and drag-n-drop dashboards, developers (and sysadmins in hoodies) were already moving files between machines using good old FTP.

And guess what? It’s still alive and kicking in many systems today.

Whether you're deploying something to a legacy box or yanking logs off an ancient server, FTP can still come in handy.

So let’s unpack what FTP does, how it works, and how you can use it efficiently.

What FTP Actually Does

At its core, FTP lets you move files between two systems over a network.

It’s like copying files from one folder to another — except the folders are on completely different machines.

When you fire up an FTP session, two channels are established:

  • Command channel: Handles stuff like login, navigation, and transfer commands.
  • Data channel: The pipe through which actual files flow.

This split setup is kind of like ordering a pizza over the phone (command) and having it delivered to your door (data).

File Transfer Modes

FTP supports multiple ways of slicing up data for transfer:

  • Stream mode: Sends data as a continuous flow. Simple and direct.
  • Block mode: Splits data into chunks — each with a header and footer.
  • Compressed mode: Uses Lempel-Ziv (yeah, the same basic idea behind ZIP files) to shrink your data on the fly.

Why Use FTP?

FTP isn’t glamorous, but it’s reliable. You can:

  • Transfer massive files (multi-GB logs, database dumps, or video assets).
  • Queue up multiple files at once.
  • Resume transfers if the network hiccups.
  • Script interactions with CLI tools — very handy in CI/CD pipelines or cron jobs.

Types of FTP: Not All Are Created Equal

You’ll come across a few flavors:

  • Plain FTP: The vanilla version. No encryption. Port 21. Easy but risky.
  • FTPS: Adds a layer of SSL/TLS security. Think of it like HTTPS for your files.
  • FTPES: Like FTPS, but starts plain and then upgrades to encryption via commands. Friendly with firewalls.
  • SFTP: Often confused with FTP but totally different — it’s based on SSH, uses a single secure channel, and defaults to port 22. It’s more modern and secure.

Getting Started with FTP:

Here’s how to actually use FTP from the command line — yes, it’s still a thing and sometimes the best option.

Copying Files to a Remote Machine

Let’s walk through sending a file to a server over FTP.

  1. Move into your local directory (the source).
cd /path/to/files
Enter fullscreen mode Exit fullscreen mode
  1. Start the FTP session.
ftp your-remote-host.com
Enter fullscreen mode Exit fullscreen mode
  1. Authenticate.

You’ll be asked for your username and password.

Some servers allow anonymous access (you just enter your email address as a password).

Name (your-remote-host.com:your-username): your-username
Password:
Enter fullscreen mode Exit fullscreen mode
  1. Change to the desired directory on the server.
ftp> cd /destination/path
Enter fullscreen mode Exit fullscreen mode

Use ls -l if you want to check permissions.

  1. Set binary mode. Always do this for non-text files (images, videos, zip files, etc.).
ftp> binary
Enter fullscreen mode Exit fullscreen mode
  1. Send a file.
ftp> put my_file.txt
Enter fullscreen mode Exit fullscreen mode
  1. Send multiple files.
ftp> mput *.log
Enter fullscreen mode Exit fullscreen mode

Note: You’ll be asked to confirm each file unless you disable prompts.

  1. Wrap it up.
ftp> bye
Enter fullscreen mode Exit fullscreen mode

Bonus: GUI Tools

Not a fan of terminal commands? No worries. There are slick FTP clients like:

  • FileZilla: Cross-platform, easy to use, free.
  • Cyberduck: Nice macOS support, also handles SFTP.
  • WinSCP: Solid for Windows users.

FTP vs The Rest

Protocol Security Port Notes
FTP None 21 Not encrypted, easy to set up
FTPS SSL/TLS 990/21 Good upgrade over FTP
SFTP SSH-based 22 Completely different protocol
HTTP Stateless, widely used 80/443 Ideal for web but not great for pushing files
MFT Secure + Managed Varies Built for compliance-heavy orgs

The Elephant in the Room: FTP Security

Here’s the deal — FTP, in its original form, is not secure.

  • Credentials are sent as plain text.
  • Data isn’t encrypted.
  • It’s vulnerable to packet sniffing, spoofing, and brute-force attacks.

If you must use FTP, prefer FTPS or SFTP. Better yet, layer it behind a VPN, lock it down with a firewall, and restrict access with user permissions.

Final Thoughts

FTP might feel like it belongs in the dinosaur era of tech, but it still plays a role in many dev environments.

Understanding how it works can help you automate deployments, and fill gaps in systems where newer tech just isn’t available.

So next time someone throws “just FTP it over” in a conversation — you’ll know exactly what to do.


I’ve been actively working on a super-convenient tool called LiveAPI.

LiveAPI helps you get all your backend APIs documented in a few minutes

With LiveAPI, you can quickly generate interactive API documentation that allows users to execute APIs directly from the browser.

Image description

If you’re tired of manually creating docs for your APIs, this tool might just make your life easier.

Top comments (0)

Some comments may only be visible to logged-in visitors. Sign in to view all comments.