Description

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


Examples




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



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.


<cpanel Module="Fileman::listfiles ( $FORM('dir','chooser','select','dirselect','usesameframe'))">




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



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