FTP
FTP client module that provides an asynchronous interface for communicating with an FTP server.
- JavaScript
- Python
Comming soon
We are releasing new Python features every week
Network Connection needs
This integration needs network access to the server where the service is running.
See the Network access page for details about how to achieve that.
If you are looking for an integration to work with SSH File Transfer Protocol (SFTP), you should use our SFTP integration.
Credential configuration
To configure this credential, you need the host
, user
and password
to connect to the FTP server.
Optionally, you can set any of the extra config parameters you can see here.
Here is an example of a filled credential configuration form in YepCode:
FTP Snippets available in YepCode editor
The title is the triggering text for YepCode to autocomplete the script.
- JavaScript
- Python
Integration
const ftpClient = yepcode.integration.ftp('credential-slug');
const Client = require('ftp');
const ftpClient = new Client();
ftpClient.connect({
host: 'hostname',
user: 'user',
password: 'password'
})
Directory Listing
ftpClient.on('ready', function() {
ftpClient.list(function(err, list) {
if (err) throw err;
console.dir(list);
ftpClient.end();
});
});
Retrieve a File
ftpClient.on('ready', function() {
ftpClient.get('readme.txt', function(err, stream) {
if (err) throw err;
stream.once('close', function() { ftpClient.end(); });
stream.pipe(fs.createWriteStream('foo.local-copy.txt'));
});
});
Upload Data
const Stream = require('stream');
const readableStream = new Stream.Readable({
// Create your readable stream
read() {}
});
ftpClient.on('ready', function() {
ftpClient.put(readableStream, 'remoteDirPath', function(err) {
if (err) throw err;
ftpClient.end();
});
});
Delete a File
ftpClient.on('ready', function() {
ftpClient.delete('remoteDirPath', function(err) {
if (err) throw err;
ftpClient.end();
});
});
Comming soon
We are releasing new Python features every week