Description

This function uploads files to the server.


Examples




$cpanel = new CPANEL(); // Connect to cPanel - only do this once.
$upload_files = $cpanel->api1('Fileman', 'uploadfiles', array('public_html', 'file1-myfile.txt', 'file2-myotherfile.txt')); // Call the function.

 



my $cpliveapi = Cpanel::LiveAPI->new(); # Connect to cPanel - only do this once.
my $upload_files = $cpliveapi->api1('Fileman', 'uploadfiles' ['public_html', 'file1-myfile.txt', 'file2-myotherfile.txt']); # Call the function.


<cpanel Module="Fileman::uploadfiles ( $FORM('dir','file1','file2'))">




cpapi1 --user=username Fileman uploadfiles public_html file1-myfile.txt file2-myotherfile.txt



test.html (test.html): upload succeeded, overwrote old file.




Parameters

ParameterTypeDescriptionPossible valuesExample
dirstring

Required

The directory to which to upload the files.

Any valid directory name.public_html
file*string

Required

The files to upload.

  • You must pass this parameter for each file that you upload.
  • You must increment each variable. For example, pass the first file as file1 and the second file as file2.


Any valid, incremented filename.file1-myfile.txt

Returns

This function returns a message of success or a reason for failure.