Child pages
  • cPanel API 1 Functions - Fileman::delfile

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Description

Excerpt

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

Include Page
LIB:_cPanelAPI1NoEquivalent
LIB:_cPanelAPI1NoEquivalent

Multiexcerpt include
SpaceWithExcerptcom.atlassian.confluence.content.render.xhtml.model.resource.identifiers.SpaceResourceIdentifier@12665
MultiExcerptNameAPIDisabledFileStorageRole
PageWithExcerptLIB:_ServerRoleDisabledAPI

Panel
bgColor#F2F2F2
borderStylenone

Examples


Panel
bgColor#FFFFFF
borderStylenone


Expand
titleLiveAPI PHP Class


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

Include Page
LIB:_LiveAPIPHPLink
LIB:_LiveAPIPHPLink


Expand
titleLiveAPI Perl Module


Code Block
languageperl
linenumberstrue
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.

Include Page
LIB:_LiveAPIPerlLink
LIB:_LiveAPIPerlLink


Expand
titlecPanel Tag System (deprecated)

Include Page
LIB:_cPanelTagsWarning
LIB:_cPanelTagsWarning

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



Expand
titleCommand Line


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

Include Page
LIB:_cPanelAPI1CLINote
LIB:_cPanelAPI1CLINote


Expand
titleOutput


Code Block
languagetext
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

Excerpt

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

Include Page
LIB:_cPanelAPI1NoEquivalent
LIB:_cPanelAPI1NoEquivalent

Multiexcerpt
MultiExcerptNameAPIDisabledFTPRole


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



Panel
bgColor#F2F2F2
borderStylenone

Examples


Panel
bgColor#FFFFFF
borderStylenone


Expand
titleLiveAPI PHP Class


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

Include Page
LIB:_LiveAPIPHPLink
LIB:_LiveAPIPHPLink


Expand
titleLiveAPI Perl Module


Code Block
languageperl
linenumberstrue
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.

Include Page
LIB:_LiveAPIPerlLink
LIB:_LiveAPIPerlLink


Expand
titlecPanel Tag System (deprecated)

Include Page
LIB:_cPanelTagsWarning
LIB:_cPanelTagsWarning

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



Expand
titleCommand Line


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

Include Page
LIB:_cPanelAPI1CLINote
LIB:_cPanelAPI1CLINote


Expand
titleOutput


Code Block
languagetext
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.