FTP/SFTP
The FTP module allows you perform various operations against an FTP or SFTP server.
📁 A comprehensive FTP client module for BoxLang that brings seamless file transfer capabilities to your applications!
This module provides powerful FTP and SFTP client functionality to the BoxLang language, making it easy to connect to FTP/SFTP servers, transfer files, and manage remote directories with minimal code.
✨ Features
🌐 FTP/FTPS/SFTP Support: Connect to standard FTP, secure FTP, and SFTP servers
📁 Complete File Operations: Upload, download, rename, and delete files on both FTP and SFTP
📂 Directory Management: Create, remove, rename, list, and navigate directories on both FTP and SFTP
🔐 Secure Connections: Support for passive/active modes (FTP) and SSH key authentication (SFTP)
🔑 SSH Key Support: SFTP with public/private key authentication and optional passphrases
🎯 Connection Pooling: Named connections tracked globally via FTPService
🔄 Proxy Support: Connect through proxy servers with custom ports (FTP only)
📊 Flexible Results: Query or array return types for directory listings
⚡ Event-Driven: Interception points for logging, monitoring, and custom logic
🛠️ Production Ready: Built by Ortus Solutions with enterprise-grade quality
🔧 Zero Configuration: Sensible defaults get you started quickly
📦 Installation
Requirements
BoxLang: 1+
Java: JDK 21+
Install via CommandBox CLI
If you are using CommandBox for your web applications, you can install it via CommandBox:
Install via BoxLang Binary
If you want to install it globally for the BoxLang OS binary, use the install-bx-module command:
The module will automatically register and be available as bx:ftp or <bx:ftp> in your BoxLang script and template applications.
From Source
🚀 Quick Start
Here's how to connect to an FTP server and upload a file in just a few lines:
That's it! 🎉 You now have a fully functional FTP client.
SFTP Quick Start
Here's how to connect to an SFTP server with password authentication:
Or with SSH key authentication:
💡 Usage Examples
Basic Examples
📁 Connect and List Files
📤 Upload a File
📥 Download a File
Advanced Examples
📊 Result Object
All FTP actions return a result object with the following structure:
Common Status Codes
200
Success
Command successful
221
Goodbye
Service closing control connection
226
Transfer complete
Closing data connection, file transfer successful
230
Login successful
User logged in
250
Success
Requested file action okay, completed
550
Failed
File unavailable or permission denied
552
Exceeded
Storage allocation exceeded
553
Not allowed
File name not allowed
Using Result Variables
🎯 Interception Points
🔗 Connection Management
❌ Error Handling
❓ Troubleshooting
🛠️ Development & Testing
🔄 CFML Compatibility
🤝 Contributing
We ❤️ contributions! This project is open source and welcomes your help to make it even better.
🐛 Found a Bug?
If you discover a bug, please:
Check existing issues at GitHub Issues
Create a new issue with:
Clear title and description
Steps to reproduce
Expected vs actual behavior
BoxLang version and environment details
Sample code that demonstrates the issue
💡 Have an Enhancement Idea?
We'd love to hear your ideas! Please:
Open a Feature Request
Describe the feature and its use case
Explain how it would benefit users
📚 Improve Documentation
Documentation improvements are always welcome:
Fix typos or unclear explanations
Add more examples
Improve code comments
Create tutorials or guides
💰 Financial Support
You can support BoxLang and all Ortus Solutions open source projects:
Patrons get exclusive benefits like:
Priority support
Early access to new features
FORGEBOX Pro account
CFCasts account
📞 Support Channels
Need help? Don't create an issue—use our support channels:
🏆 Contributors
Thank you to all our amazing contributors! ❤️
Made with contributors-img
🔐 Security Vulnerabilities
If you discover a security vulnerability:
DO NOT create a public issue
Report in
#securitychannel on Box Team Slack
All vulnerabilities will be promptly addressed.
📄 License
This project is licensed under the Apache License 2.0.
See LICENSE file for full details.
💼 Support & Resources
📖 Documentation
Module Docs: You're reading them! 📚
BoxLang Docs: https://boxlang.ortusbooks.com/
Apache Commons Net: https://commons.apache.org/proper/commons-net/
🌐 Links
BoxLang Website: https://boxlang.io
Ortus Solutions: https://www.ortussolutions.com
GitHub Repository: https://github.com/ortus-boxlang/bx-ftp
Issue Tracker: https://github.com/ortus-boxlang/bx-ftp/issues
ForgeBox: https://forgebox.io/view/bx-ftp
🎓 Learning Resources
BoxLang Training: https://www.ortussolutions.com/services/training
CFCasts: https://www.cfcasts.com
Last updated
Was this helpful?
