Export files to FTP servers
🤖/ftp/store exports encoding results to your FTP servers. This Robot relies on password access. For more security, consider our /sftp/store Robot.
Usage example
Export uploaded files to my_target_folder
on an FTP server:
{
"steps": {
"exported": {
"robot": "/ftp/store",
"use": ":original",
"credentials": "YOUR_FTP_CREDENTIALS",
"path": "my_target_folder/${unique_prefix}/${file.url_name}"
}
}
}
Parameters
-
use
String / Array of Strings / Object requiredSpecifies which Step(s) to use as input.
-
You can pick any names for Steps except
":original"
(reserved for user uploads handled by Transloadit) -
You can provide several Steps as input with arrays:
"use": [ ":original", "encoded", "resized" ]
💡 That’s likely all you need to know about
use
, but you can view Advanced use cases. -
-
credentials
StringrequiredPlease create your associated Template Credentials in your Transloadit account and use the name of your Template Credentials as this parameter's value. They will contain the values for your FTP host, user and password.
While we recommend to use Template Credentials at all times, some use cases demand dynamic credentials for which using Template Credentials with their static nature is too unwieldy. If you have this requirement, feel free to use the following parameters instead:
"host"
,"user"
,"password"
. -
path
String ⋅ default:"${unique_prefix}/${file.url_name}"
The path at which the file is to be stored. This can contain any available Assembly variables.
Please note that you might need to include your homedir at the beginning of the path.
-
port
Integer(1
-65535
) ⋅ default:21
The port to use for the FTP connection.
-
url_template
String ⋅ default:"https://{HOST}/{PATH}"
The URL of the file in the result JSON. The following Assembly variables are supported.
-
ssl_url_template
String ⋅ default:"https://{HOST}/{PATH}"
The SSL URL of the file in the result JSON. The following Assembly variables are supported.
-
secure
Boolean ⋅ default:false
Determines whether to establish a secure connection to the FTP server using SSL.
Note: The URLs in the result JSON already point to the file on your target storage platform, so you can just save that URL in your database.
You can influence the URL using the Robot's
url_template
parameter.
Things to keep in mind
- Your server might be unresponsive from time to time. Since (S)FTP servers are harder to scale, we see this happen a lot. As a result, if this Robot fails to store one of your files, it will retry to store the file 5 times over 15 minutes.
- This also means that when you provided the wrong credentials (when testing for example) Assemblies can take up to 15 minutes to complete.
- If an Assembly has an export Step and takes long to execute, it is almost always due to the export Step having wrong credentials or the server being unreachable.
We advise you to use 🤖/sftp/store and 🤖/sftp/import when possible, as it is much more secure. The FTP Robots should only serve as a fallback in case cloud storage or SFTP cannot be used.
Demos
- Copy files from Azure to FTP servers
- Copy files from Backblaze to FTP servers
- Copy files from DigitalOcean Spaces to FTP servers
- Copy files from Dropbox to FTP servers
- Copy files from Google Storage to FTP servers
- Copy files from MinIO to FTP servers
- Copy files from Openstack/Swift to FTP servers
- Copy files from Rackspace Cloud Files to FTP servers
- Copy files from SFTP servers to FTP servers
- Copy files from Supabase to FTP servers
- Copy files from Wasabi to FTP servers
- Copy files from Webservers to FTP servers
- Copy files from cloudflare to FTP servers
- Store all uploaded files on an FTP server
Related blog posts
- Introducing new FTP store Robot for easier exports May 29, 2012
- New pricing model for future Transloadit customers February 7, 2018