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

Versions Compared

Key

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

Description

Excerpt

This function lists a directory's files, permissions, and some display options.


Warning
titleWarning:

Include Page
LIB:_cPanelAPI1NewerFunctions
LIB:_cPanelAPI1NewerFunctions

  • UAPI (recommended)
    • Fileman::get_file_information
      Excerpt Include
      DD:UAPI Functions - Fileman::get_file_informationDD:
      UAPI Functions - Fileman::get_file_information
      nopaneltrue
    • Fileman::list_files
      Excerpt Include
      DD:UAPI Functions - Fileman::list_filesDD:
      UAPI Functions - Fileman::list_files
      nopaneltrue
  • cPanel API 2 Fileman::listfiles
    Excerpt Include
    DD:cPanel API 2 Functions - Fileman::listfilesDD:
    cPanel API 2 Functions - Fileman::listfiles
    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.
$list_files = $cpanel->api1('Fileman', 'listfiles', array('public_html', '1', select.html', 'seldir.html', '0')); // 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 $list_files = $cpliveapi->api1('Fileman', 'listfiles' ['public_html', '1', select.html', 'seldir.html', '0']); # 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::listfiles ( $FORM('dir','chooser','select','dirselect','usesameframe'))">



Expand
titleCommand Line


Code Block
cpapi1 --user=username Fileman listfiles public_html 1 select.html seldir.html 0

Include Page
LIB:_cPanelAPI1CLINote
LIB:_cPanelAPI1CLINote


Expand
titleOutput (HTML)


Code Block
languagexml
<table width=\"100%\"><tr><td><a href=\"?dir=%2fhome%2fexampleuser%2fexample.com/\"><img src=\"../mimeicons/httpd-unix-directory.png\" border=0></a></td><td><a href=\"?dir=/\">/</a> <a href=\"?dir=/dink5.com%2f\">example.com</a> /  (Current Folder)</a>\n</td><td></td><td></td></tr>\n <tr><td><a href=\"?dir=%2fhome%2fexampleuser%2f\"><img src=\"../mimeicons/httpd-unix-directory.png\" border=\"0\"></a></td><td><a href=\"?dir=%2fhome%2fexampleuser%2f\"><b>Up one level</b></a></td><td></td><td></td></tr>\n<tr><td><a href=\"?dir=%2fhome%2fexampleuser%2fexample.com/assets\"><img src=\"../mimeicons/httpd-unix-directory.png\" border=\"0\"></a></td><td><a href=\"dirselect=index.html?dir=%2fhome%2fexampleuser%2fexample.com&file=assets\">assets</a></td><td></td><td>755</td></tr>
...
</table>




Parameters

ParameterTypeDescriptionPossible valuesExample
dirstring

The files' directory.

This value defaults to /home.

Any valid directory./user
chooserBoolean

Required

Whether to print extra links to upload files, and create files and new folders.

  • 0 — Print files with extra links.
  • 1 — Print files without extra links.
1
selectstring

The file's arguments to link to a specified HTML page.

This value defaults to select.html.

Any valid filename.select.html
dirselectstring

Required

The HTML page to which to send the specified files' arguments.

Any valid HTML page name.seldir.html
usesameframeBoolean

Required

Whether to create links that open selected files in a new browser window.

  • 0 — Create links that open selected files in a new window.
  • 1 — Create links that open selected files in the same window.
1

Returns

This function returns the specified directory's files, permissions, and display options in HTML format.