To create an FTP account on a site, use the add operation. The number of accounts that can be created on a particular site is restricted with the 'Maximum number of additional FTP accounts site limit, or/and by customer limit of the same name.
Note: Plesk customers can specify quota on disk space used by home directory only if they are granted the Hard disk quota assignment permission.
Request Packet Structure
A request XML packet creating FTP account on a site includes the add operation node:
The add node is presented by the FtpUserAddInputType complex type (
ftpuser.xsd). The node has the following graphical representation:
- The name node is required. It specifies the name under which the FTP account will be known in Plesk, and the account login. Data type: string.
- The password node is required. It specifies the FTP account password. Data type: string.
- The home node is required. It specifies the home directory of the account, i.e., the directory access to which is granted for the account user. Data type: string.
- The create-non-existent node is optional. It specifies if the home directory should be created or not. This node with value
trueis required if the home directory defined by the home node does not exist on the site. Data type: boolean.
- The quota node is optional. It specifies the maximum total size of files and folders (in bytes) that the FTP account user can create in or upload to the home directory. Data type: integer.
- The permissions node is optional. It specifies the FTP account permissions for home directory. For more information, refer to section FTP Account Permissions. Data type: FtpUserPermissions.
- The webspace-id node is required. It specifies the ID of the site on which the FTP account is created. Data type: integer.
- The webspace-name node is required. It specifies the name of the site (in unicode) on which the FTP account is created. Data type: string.
1. FTP account name must be unique in Plesk, meaning that two FTP accounts with the same name cannot be crated, even if you want to crate them on different sites.
2. The default home directory for any new additional FTP account is the site root directory (namely, "/"). If you want FTP account created with request packet to have a default home directory, include an empty home node to your request:
If you want to specify account home directory other than default, in the home node specify a full path to desired directory, starting with root site directory. For example:
3. Creating new folders in the site's root directory is prohibited by Plesk. Therefore, it is impossible to make some /Global_Upload folder a home directory for an account. Do not include to your packets lines like
4. To create FTP account with unlimited quota, specify value "-1" in the quota node:
5. With one add operation, you can create only one FTP account on a site specified either by name or by ID.
6. With one packet, you can create as many different FTP accounts on different sites as you want. To create multiple FTP accounts, use the required number of add nodes in the packet.
Important: When creating request packets, put nodes and elements in the order they follow in the packet structure.
Response Packet Structure
The add node of the output XML packet is structured as follows:
- The result node is required. It wraps the response received from the server. Data type: FtpUserSimpleResultType (
- The status node is required. Specifies the execution status of the add operation. Data type: string. Allowed values: ok | error.
- The errcode node is optional. Is used to return the error code when the add operation fails. Data type: unsignedInt.
- The errtext node is optional. Is used to return the error message if the add operation fails. Data type: string.
- The id node is required if the operation succeeds. It returns the unique identifier of the FTP account created with the add operation. Data type: integer.
Creating single FTP account on a site
This packet creates FTP account, with only required settings specified, on site with ID "48". The FTP account created with this packet will have name and login ftpuser1 and password jdnHHbe6Gc. User of this account will have access to the site directory
httpdocs, with unspecified permissions. Total size of files that this FTP user is allowed to upload will be limited to default values defined by site or site owner limits.
Creating multiple FTP accounts
This packet creates three FTP accounts on site example.com. Two of these accounts will have read and write permissions on accessing directory
Incoming located in folder
/private/photoshare which does not exist on the site and which will be created with this request packet. The third user created with the packet will have only read permission on accessing the same directory. Total size of files that the FTP users are allowed to upload will be limited to 100 Mbytes.