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

Versions Compared

Key

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

Description

Excerpt

This function uploads files to the server.


Warning
titleWarning:

Include Page
LIB:_cPanelAPI1NewerFunctions
LIB:_cPanelAPI1NewerFunctions

  • UAPI (recommended)Fileman::upload_files
    Excerpt Include
    DD:UAPI Functions - Fileman::upload_filesDD:
    UAPI Functions - Fileman::upload_files
    nopaneltrue
  • cPanel API 2Fileman::uploadfiles
    Excerpt Include
    DD:cPanel API 2 Functions - Fileman::uploadfilesDD:
    cPanel API 2 Functions - Fileman::uploadfiles
    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.
$upload_files = $cpanel->api1('Fileman', 'uploadfiles', array('public_html', 'file1-myfile.txt', 'file2-myotherfile.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 $upload_files = $cpliveapi->api1('Fileman', 'uploadfiles' ['public_html', 'file1-myfile.txt', 'file2-myotherfile.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::uploadfiles ( $FORM('dir','file1','file2'))">



Expand
titleCommand Line


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

Include Page
LIB:_cPanelAPI1CLINote
LIB:_cPanelAPI1CLINote


Expand
titleOutput (plaintext)


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

Warning
titleImportant:
  • 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.