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

Versions Compared

Key

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

Description

Excerpt

This function moves or copies a file to a different directory.


Warning
titleWarning:

Include Page
LIB:_cPanelAPI1NewerFunctions
LIB:_cPanelAPI1NewerFunctions

  • UAPI (recommended)None.
  • cPanel API 2 Fileman::fileop
    Excerpt Include
    DD:cPanel API 2 Functions - Fileman::fileop
    DD:cPanel API 2 Functions - Fileman::fileop
    nopaneltrue

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.
$move_file = $cpanel->api1('Fileman', 'dofileop', array('public_html', 'myfile.txt', 'user2', 'move')); // 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 $move_file = $cpliveapi->api1('Fileman', 'dofileop' ['public_html', 'myfile.txt', 'user2', 'move']); # 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::dofileop ( $FORM('opdir','opfile','dir','fileop'))">



Expand
titleCommand Line


Code Block
languagebash
cpapi1 --user=username Fileman dofileop public_html myfile.txt user2 move

Include Page
LIB:_cPanelAPI1CLINote
LIB:_cPanelAPI1CLINote


Expand
titleOutput (none)

This functions does not return any output.



Parameters

ParameterTypeDescriptionPossible valuesExample
opdirstring

The file's directory.

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

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

Required

The file to move or copy.

Any valid filename.myfile.txt
dirstring

Required

The file's new location.

Any valid directory.user2
fileopstring

Required

The operation to perform.

  • copy
  • move
move

Returns

This function does not return output.