Description

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


Examples




$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.



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.


<cpanel Module="Fileman::dofileop ( $FORM('opdir','opfile','dir','fileop'))">




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


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.