Description


This function prints the contents of a file to the web browser.



Examples




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



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


<cpanel Module="Fileman::getfile ( $FORM('dir','file'))">




cpapi1 --user=username Fileman getfile public_html myfile.txt



These are the contents of the file.




Parameters

ParameterTypeDescriptionPossible valuesExample
dirstring

The file's directory.

This value defaults to the user's /home directory.

Any valid directory, relative to the cPanel account's /home directory.public_html
filestring

Required

The file to display.

Any valid file name.myfile.txt

Returns

This function returns the file's contents.