used for transferring files between a client and a server over a TCP/IP network (like the Internet).
FTP has two primary transfer modes you need to choose based on the type of file:
| File Type |
FTP Transfer Mode |
Why? |
| Text files (.txt, .html, .xml, .csv, .css, .js) |
ASCII |
ASCII mode converts line endings properly (especially between Windows/Linux) |
*
| Program source code (.c, .cpp, .py, .java, .php) |
ASCII |
Source code is treated as text, needs consistent line endings |
| Web scripts (.pl, .php, .asp) |
ASCII |
Same reason: treated as text files |
| Images (.jpg, .png, .gif, .bmp) |
Binary |
Binary mode preserves exact byte sequence (no line ending conversion) |
| Videos (.mp4, .avi, .mov) |
Binary |
No changes should be made, pure binary transfer |
| Audio files (.mp3, .wav) |
Binary |
Audio data must not be altered during transfer |
| Compressed files (.zip, .tar.gz, .rar) |
Binary |
Compression formats require bit-perfect copying |
| Database dumps (.sql) |
ASCII (usually) |
Dump files are text — ASCII is safer to avoid corruption |
| Executable files (.exe, .bin, .dll) |
Binary |
Must transfer without modification |
Some modern FTP clients (like FileZilla, WinSCP) can auto-detect the correct mode, but it’s good to manually set it when unsure — especially for critical uploads.