Results 1 to 3 of 3

Thread: fileman listfiles help

  1. #1
    Registered User
    Join Date
    May 2012
    Posts
    2
    cPanel/WHM Access Level

    Reseller Owner

    Unhappy fileman listfiles help

    Hello,

    I am trying to make a program to display file(file manager) list in the browser. Here is my code:

    Code:
    <?php
    include "/home/xxxx/public_html/backup/xmlapi.php";
    
    $ip = "example.com";
    $cp_user = 'username';
    $cp_pass = 'password';
    $confirm_email_addy = 'example@gmail.com';
    
    $dir_path = '/';
    $choser_dir = '1';
    $select_d = 'sample.html';
    $dirselect_dir ='sample.html';
    $usesameframe_dir = '0';
    
    // Instantiate object
    $xmlapi = new xmlapi($ip);
    
    // Set to use secure cPanel port
    //  you will have to alter this to 2082 if your PHP doesn't have SSL support enabled
    $xmlapi->set_port('2083');
    
    // Set cPanel credentials
    $xmlapi->password_auth($cp_user, $cp_pass);
    
    // Uncommentfor debugging
    //$xmlapi->set_debug(1);
    
    // Setup an ordinal array with arguments in proper order
    $args = array(
       
        $dir_path,         
        $choser_dir, 
    	$select_d,          
        $remote_pass,           
        $dirselect_dir,    
        $usesameframe_dir,           
       
    );
    
    // Make API1 query
    $results = $xmlapi->api1_query($cp_user, 'Fileman', 'listfiles', $args);
    
    
    
    
    
    
    ?>
    the output doesn't display on the browser. I need a help with the coding...

    Thanks

  2. #2
    Technical Product Specialist cPanelDavidG's Avatar
    Join Date
    Nov 2006
    Location
    Houston, TX
    Posts
    11,307
    cPanel/WHM Access Level

    Root Administrator

    Default Re: fileman listfiles help

    Does this behavior persist if you set $dir_path to '' (an empty string) ?

  3. #3
    Member
    Join Date
    Jul 2011
    Location
    Palmerston North, New Zealand
    Posts
    41
    cPanel/WHM Access Level

    Root Administrator

    Default Re: fileman listfiles help

    You need to actually output something to the browser, there is no output whatsoever in the script you posted.
    Try something like:
    Code:
    print_r($results);
    This should only be used in development, in post-production use you should be custom formatting the layout so its user friendly, e.g. creating a User Interface.

    Depending on the contents of '$results' you could try something like (EXAMPLE ONLY):
    Code:
    foreach ($results as $entry)
    {
    echo "<p>$entry<p><br>\n";
    }
    If '$results' contains HTML already then the following would be what you are after:
    Code:
    echo $result;
    Regards
    Stefan Andres Charsley
    WebFront.co.nz

Similar Threads

  1. Fileman - will not save.
    By SScott in forum cPanel & WHM Discussions
    Replies: 5
    Last Post: 09-18-2012, 07:18 AM
  2. Fileman::uploadfiles
    By Andy Fletcher in forum cPanel Developers
    Replies: 7
    Last Post: 10-12-2010, 02:08 PM
  3. about Fileman module !!
    By black-code in forum cPanel & WHM Discussions
    Replies: 0
    Last Post: 09-05-2008, 09:39 AM
  4. Fileman
    By Jubi in forum cPanel & WHM Discussions
    Replies: 0
    Last Post: 11-29-2004, 06:03 PM
  5. listfiles()
    By strauberry in forum cPanel & WHM Discussions
    Replies: 0
    Last Post: 04-05-2003, 03:29 AM