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

Versions Compared

Key

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

Description

Excerpt

This function displays a file.


Warning
titleWarning:

Include Page
LIB:_cPanelAPI1NewerFunctions
LIB:_cPanelAPI1NewerFunctions

  • UAPI (recommended) Fileman::list_files
    Excerpt Include
    DD:UAPI Functions - Fileman::list_filesDD:
    UAPI Functions - Fileman::list_files
    nopaneltrue
  • cPanel API 2 Fileman::viewfile
    Excerpt Include
    DD:cPanel API 2 Functions - Fileman::viewfileDD:
    cPanel API 2 Functions - Fileman::viewfile
    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.
$view_file = $cpanel->api1('Fileman', 'viewfile', array('public_html', 'myfile')); // 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 $view_file = $cpliveapi->api1('Fileman', 'viewfile' ['public_html', 'myfile']); # 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::viewfile ( $FORM('dir','file'))">



Expand
titleCommand Line


Code Block
cpapi1 --user=username Filename viewfile public_html myfile

Include Page
LIB:_cPanelAPI1CLINote
LIB:_cPanelAPI1CLINote


Expand
titleOutput (HTML)


Code Block
languagexml
<img src="images/gnome-textfile.gif"> <b><font size=+1>test.txt</font></b>
 <br>File Type: ASCII text




Parameters

ParameterTypeDescriptionPossible valuesExample
dirstring

Required

The file's directory.

Any valid directory name.user
filestring

Required

The file.

Any valid filenamemyfile

Returns

This function returns HTML that displays the file's properties.