Blog

BoxLang FTP Support has landed

Luis Majano January 17, 2025

Spread the word

Luis Majano

January 17, 2025

Spread the word


Share your thoughts

We’re excited to announce the release of the bx-ftp module for BoxLang! This powerful module enables seamless interaction between your BoxLang applications and FTP servers. Whether you need to upload files, download content, or manage directories on an FTP server, the bx-ftp module has you covered.

Key Features

  • Open and manage FTP connections effortlessly, even with proxy servers.
  • Perform directory and file operations, including listing, renaming, and removing.
  • Supports secure connections, passive mode, and proxy configurations.
  • Flexible result handling with detailed response metadata.
  • Receive listing results not only as queries, but array of structs

Reporting Issues

If you encounter any issues or have feature requests, please report them to:

Please send us your feedback and testing!

Quick Usage

You can find much more information at the module's readme: https://github.com/ortus-boxlang/bx-ftp and the coming docs page: https://boxlang.ortusbooks.com/boxlang-framework/modularity/ftp

You can leverage the bx:ftp component call in your BoxLang applications. Below are some common usage examples:

Connect to an FTP Server

bx:ftp 
    action="open" 
    connection="myConnection" 
    server="ftp.example.com" 
    username="myuser" 
    password="mypass";

List Directory Contents

bx:ftp 
    action="listdir" 
    connection="myConnection" 
    directory="/" name="results"
    returnType="array";

Download a File

bx:ftp 
    action="getfile" 
    connection="myConnection" 
    remoteFile="/path/to/remote/file.txt" 
    localFile="/path/to/local/file.txt";

Upload a File

bx:ftp 
    action="putfile" 
    connection="myConnection" 
    localFile="/path/to/local/file.txt" 
    remoteFile="/path/to/remote/file.txt";

Close the Connection

bx:ftp action="close" connection="myConnection";

Note: The connection attribute is required for all actions, as it references the active connection managed by BoxLang’s FTPService.

Available Actions

The module supports a wide range of actions categorized into:

Connection Actions

  • open: Open a connection to an FTP server.
  • close: Close an existing connection.

Directory Actions

  • changeDir: Change the current directory.
  • createDir: Create a new directory.
  • existsDir: Check if a directory exists.
  • getCurrentDir: Get the current working directory.
  • listDir: List the contents of a directory.
  • removeDir: Remove a directory.
  • renameDir: Rename a directory.

File Actions

  • removeFile: Remove a file.
  • renameFile: Rename a file.
  • putFile: Upload a file to the server.
  • getFile: Download a file from the server.
  • existsFile: Check if a file exists on the server.

Each action can use a result attribute to store the operation’s outcome in a variable. By default, the results are stored in the bxftp variable (or cftp in CFML compatibility mode).

Example: Working with Results

bx:ftp 
    action="listdir" 
    connection="myConnection" 
    directory="/" 
    result="ftpResult";
assert ftpResult.returnValue.recordCount == 5;

Result Object Keys

  • statusCode: Integer representing the action’s status code.
  • statusText: String describing the action’s status.
  • returnValue: Action-specific return value (if any).
  • succeeded: Boolean indicating whether the action was successful.

CFML Compatibility

For CFML-style functionality, you can integrate the bx-cfml-compat module. This ensures compatibility with Adobe ColdFusion and Lucee.


Start building powerful FTP-enabled applications with BoxLang today! For more details, check out the bx-ftp documentation and stay tuned for more updates.

Add Your Comment

Recent Entries

12 Days of BoxLang - Day 4: TestBox

12 Days of BoxLang - Day 4: TestBox

Today we’re celebrating one of the most exciting new additions to the BoxLang ecosystem:

the TestBox BoxLang CLI Runner — a fast, native way to run your TestBox tests directly through the BoxLang Runtime. ⚡

No server required. No CommandBox needed. Just pure, ultra-fast BoxLang-powered testing from the command lineon Windows, Mac, and Linux.

If you’re building modern applications with BoxLang — web apps, CLIs, serverless functions, Android apps, or OS-level utilities — this new feature gives you a unified, flexible testing workflow you can run anywhere.

Victor Campos
Victor Campos
December 13, 2025
12 days of BoxLang - Day 3: SocketBox!

12 days of BoxLang - Day 3: SocketBox!

As BoxLang continues evolving into a modern, high-performance, JVM-based runtime, real-time communication becomes essential for the applications we all want to build: dashboards, collaboration tools, notifications, live feeds, multiplayer features, and more.

That’s where SocketBox steps in — the WebSocket upgrade listener built to work seamlessly with CommandBox and the BoxLang MiniServer. ⚡

Today, for Day 3, we’re highlighting how SocketBox supercharges BoxLang development by giving you fast, flexible, and framework-agnostic WebSocket capabilities.

Maria Jose Herrera
Maria Jose Herrera
December 12, 2025
12 Days of BoxLang - Day 2: CommandBox

12 Days of BoxLang - Day 2: CommandBox

BoxLang + CommandBox: The Enterprise Engine Behind Your Deployments

For Day 2 of our 12 Days of Christmas series, we’re diving into one of the most powerful parts of the BoxLang ecosystem: CommandBox the defacto enterprise servlet deployment platform for BoxLang.

If BoxLang is the language powering your applications, CommandBox is the engine room behind it all. ⚙️

Victor Campos
Victor Campos
December 11, 2025