Child pages
  • cPanel API 1 Functions - Ftp::addftp
Skip to end of metadata
Go to start of metadata

Description

This function creates a new FTP account.

Warning:

cPanel API 1 is deprecated. Do not use this function. Instead, we strongly recommend that you use the following newer functions:

Important:

In cPanel & WHM version 76 and later, when you disable the FTP role, the system disables this function. For more information, read our How to Use Server Profiles documentation.

Examples


 LiveAPI PHP Class
$cpanel = new CPANEL(); // Connect to cPanel - only do this once.
$add_ftp = $cpanel->api1('Ftp','addftp', array('user','12345luggage','usernameftp','0','0','public_html/usernameftp') ); // Call the function.


Note:

For more information, read our Guide to the LiveAPI System.

 

 LiveAPI Perl Module
my $cpliveapi = Cpanel::LiveAPI->new(); # Connect to cPanel - only do this once.
my $add_ftp = $cpliveapi->api1('Ftp','addftp', ['user','12345luggage','usernameftp','0','0','public_html/usernameftp'] ); # Call the function.


Note:

For more information, read our Guide to the LiveAPI System.

 

 cPanel Tag System (deprecated)


Warning:

In cPanel & WHM version 11.30 and later, cPanel tags are deprecated. We provide this example to help developers move from the old cPanel tag system to our LiveAPI system. We strongly recommend that you only use the LiveAPI system to call the cPanel APIs.

<cpanel Module="Ftp::addftp( $FORM('user','pass','homedir','quota','disallowdot','homedir2'))">
 Command Line
cpapi1 --user=username Ftp addftp user 12345luggage

Note:

For more information and additional output options, read our Guide to cPanel API 1 documentation or run the cpapi1 --help command.  

 Output (none)
This function does not return output.

Parameters

ParameterTypeDescriptionPossible valuesExample
userstring

Required

The FTP username.

A valid FTP username on the account.

user
passstring

Required

The FTP password.

A secure password.
12345luggage
homedirstring

The FTP account's home directory.

If you do not specify a path, the FTP account uses the cPanel account's home directory.

A valid path, relative to the cPanel account's home directory.
public_ftp
quotaBoolean

The quota of the new FTP account.

This value defaults to 0, which grants an unlimited quota.

  • A valid integer which measures the quota size, in bytes.
  • 0 — An unlimited quota.
0
disallowdotBoolean

Whether to strip the dots from the username.

This value defaults to 1.

  • 1 — Strip dots from the username.
  • 0 — Allow dots in the username.
0
homedir2string

Note:

We deprecated this parameter in cPanel & WHM version 11.

 
 

Returns

This function does not return output.