WordPress File Upload plugin has the ability to perform FTP uploads and store the uploaded files using FTP protocol. This feature is useful in two cases:
- When we want to store the uploaded files to an FTP server other than the website,
- When we want to store the uploaded files to the website but permission issues force the use of FTP.
It works like this:
- The files are first uploaded to a temporary directory on the web server using normal HTTP upload (browsers do not support direct FTP transfers).
- The plugin transfers the files from the web server to the final destination using FTP protocol and credentials provided in the upload form shortcode.
Here are instructions how to configure FTP uploads with WordPress File Upload plugin:
1. Activate FTP method
To do this open the visual editor of the shortcode, go to General tab and select ‘ftp‘ option in Folder Access Method attribute:
The right-hand FTP attributes will be enabled.
2. Enter the FTP credentials
In order to connect to an FTP server a username, password, FTP host and optionally a port are required. These are entered in FTP Access Credentials attribute in the following format:
For instance for the following credentials:
FTP domain: ftp.iptanus.com
Here are some extra tips about this attribute:
- If the username or the password contain the characters : or @ then they must be preceded by a double backslash \\ in order to avoid confusion with the attribute’s separators, e.g. if the username is firstname.lastname@example.org then FTP Access Credentials attribute should be: nickolas\\@domain.com:email@example.com
- Port number is optional and can be omitted
- Secure FTP (sftp) protocol is also supported, provided that the required libraries are installed on the web server. To use it put character ‘s’ before the port like this: nickolas:firstname.lastname@example.org:s22
- Use only the clean FTP domain in this attribute, without any folders added after the domain.
3. Enter the FTP Upload Path
In case that the files are not stored in the FTP root path but in a subfolder, define it in Upload Path attribute like this:
Using the above example, files will be stored to ftp.iptanus.com/uploads/inbox.
- If attribute Create Upload Path is also activated in the shortcode, then the upload path will be created automatically if it does not exist already.
4. Activate FTP Domain Attribute
In most cases attribute Use FTP Domain must also be activated, in order to let the plugin know that files will be uploaded in another FTP server, not the website.
5. Other FTP Options
Another two options are provided, passive mode and permissions of uploaded files:
- FTP Passive Mode: enable it in case active FTP mode is not allowed by the FTP server.
- Permissions of Uploaded File: by default the uploaded files will inherit the permissions of the parent folder, usually 0755 (octal). Other permissions can be defined in the form of a 4-digit octal number.
Please note that FTP mode does not work with chunked uploads for the moment. This means that when FTP mode is enabled the size of the uploaded files is limited by the restrictions of the web server.
For any questions or information, please contact us.
The Iptanus Team