Description

This function deletes a file and backs it up in the /trash directory.

Examples




$cpanel = new CPANEL(); // Connect to cPanel - only do this once.
$delete_file = $cpanel->api1('Fileman', 'delfile', array ('user', 'myfile.txt')); // Call the function.



my $cpliveapi = Cpanel::LiveAPI->new(); # Connect to cPanel - only do this once.
my $delete_file = $cpliveapi->api1('Fileman', 'delfile' ['user', 'myfile.txt']); # Call the function.


<cpanel Module="Fileman::delfile ( $FORM('dir','file'))">




cpapi1 --user=username Fileman delfile public_html myfile.txt



1




Parameters

ParameterTypeDescriptionPossible valuesExample
dirstring

The file's directory directory.

This parameter defaults to the cPanel account's /home directory.

 

Any valid directory, relative to the account's /home directory.public_html
filestring

Required

The file.

Any valid file name.myfile.txt

Returns

  • 1 — The function succeeded.
  • An error message — The function failed.

 

 

 

 


Description

This function deletes a file and backs it up in the /trash directory.


In cPanel & WHM version 76, the FTP role affects this function.



Examples




$cpanel = new CPANEL(); // Connect to cPanel - only do this once.
$delete_file = $cpanel->api1('Fileman', 'delfile', array ('user', 'myfile.txt')); // Call the function.



my $cpliveapi = Cpanel::LiveAPI->new(); # Connect to cPanel - only do this once.
my $delete_file = $cpliveapi->api1('Fileman', 'delfile' ['user', 'myfile.txt']); # Call the function.


<cpanel Module="Fileman::delfile ( $FORM('dir','file'))">




cpapi1 --user=username Fileman delfile public_html myfile.txt



1




Parameters

ParameterTypeDescriptionPossible valuesExample
dirstring

The file's directory directory.

This parameter defaults to the cPanel account's /home directory.

 

Any valid directory, relative to the account's /home directory.public_html
filestring

Required

The file.

Any valid file name.myfile.txt

Returns

  • 1 — The function succeeded.
  • An error message — The function failed.