!C99Shell v. 2.1 [PHP 8 Update] [02.02.2022]!

Software: Apache/2.4.53 (Unix) OpenSSL/1.1.1o PHP/7.4.29 mod_perl/2.0.12 Perl/v5.34.1. PHP/7.4.29 

uname -a: Linux vps-2738122-x 4.15.0-213-generic #224-Ubuntu SMP Mon Jun 19 13:30:12 UTC 2023 x86_64 

uid=1(daemon) gid=1(daemon) grupos=1(daemon) 

Safe-mode: OFF (not secure)

/opt/lampp/lib/php/doc/Net_FTP/example/   drwxr-xr-x
Free 9.83 GB of 61.93 GB (15.87%)
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Feedback    Self remove    Logout    


Viewing file:     observer.php (5.56 KB)      -rw-r--r--
Select action/file-type:
(+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<?php

/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */

/**
 * Net_FTP observer example.
 *
 * Net FTP Observer example to use with HTML_Progress package
 * (PHP 4 >= PHP 4.3.0)
 *
 * PHP versions 4 and 5
 *
 * LICENSE: This source file is subject to version 3.0 of the PHP license
 * that is available through the world-wide-web at the following URI:
 * http://www.php.net/license/3_0.txt.  If you did not receive a copy of
 * the PHP License and are unable to obtain it through the web, please
 * send a note to license@php.net so we can mail you a copy immediately.
 *
 * @category   Networking
 * @package    FTP
 * @author     Tobias Schlitt <toby@php.net>
 * @author     Laurent Laville <pear@laurent-laville.org>
 * @copyright  1997-2005 The PHP Group
 * @license    http://www.php.net/license/3_0.txt  PHP License 3.0
 * @version    CVS: $Id: observer.php,v 1.2 2005/02/23 12:12:23 toby Exp $
 * @link       http://pear.php.net/package/Net_FTP
 * @link       http://pear.php.net/package/HTML_Progress
 * @since      File available since Release 1.3.0
 */

require_once 'Net/FTP.php';
require_once 
'Net/FTP/Observer.php';
require_once 
'HTML/Progress.php';

/**
 * Initializing test variables (required!)
 */
$ftp = array(
    
'host' => '',
    
'port' => 21,
    
'user' => '',
    
'pass' => ''
);    

$dest 'tmp';                   // this directory must exists in your ftp server !
$overwrite true;               // overwrite all existing files on the ftp server
$files = array(
    
'HTML_Progress-1.2.0.tgz',
    
'php4ever.png'               // initializing contents (required!) file(s) must exists
);                               // file(s) to upload


//
// 1. Defines the FTP/Progress Observer 
//
class Observer_ProgressUpload extends Net_FTP_Observer
{
    var 
$progress;

    function 
Observer_ProgressUpload(&$progress)
    {
        
/* Call the base class constructor. */
        
parent::Net_FTP_Observer();

        
/**
           Configure the observer:
           
           Be sure to have an indeterminate progress meter when
           @link http://www.php.net/manual/en/function.ftp-nb-put.php
           stores a file on the FTP server (non-blocking)
         */
        
$this->progress =& $progress;
        
$this->progress->setIndeterminate(true);
    }

    function 
notify($event)
    {
        
$this->progress->display();
        
$this->progress->sleep();
                 
        if (
$this->progress->getPercentComplete() == 1) {
            
$this->progress->setValue(0);
        } else {
            
$this->progress->incValue();
        }
    }
}

//
// 2. defines the progress meter 
//
$meter = new HTML_Progress();
$ui = & $meter->getUI();
$ui->setProgressAttributes(array(
    
'background-color' => '#e0e0e0'
));        
$ui->setStringAttributes(array(
    
'color'  => '#996',
    
'background-color' => '#CCCC99'
));        
$ui->setCellAttributes(array(
    
'active-color' => '#996'
));

$meter->setAnimSpeed(200);
$meter->setIncrement(10);
$meter->setStringPainted(true);     // get space for the string
$meter->setString("");              // but don't paint it
$meter->setIndeterminate(true);     // progress meter start in indeterminate mode
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>FTP/Progress Observer example</title>
<style type="text/css">
<!--
body {
    background-color: #CCCC99;
    color: #996;
    font-family: Verdana, Arial;
}

<?php echo $meter->getStyle(); ?>
// -->
</style>
<script type="text/javascript">
<!--
<?php echo $meter->getScript(); ?>
//-->
</script>
</head>
<body>

<?php 
echo $meter->toHtml();
@
set_time_limit(0);  // unlimited time operation (removed 30s default restriction)

$f = new Net_FTP();

//
// 3. connect to the FTP server 
//
$ret $f->connect($ftp['host'], $ftp['port']);
if (
PEAR::isError($ret)) {
    die(
$ret->getMessage());
}
printf('connected at <b>%s</b><br />'$ftp['host']);

//
// 4. login to the FTP server as a well-known user
//
$ret $f->login($ftp['user'], $ftp['pass']);
if (
PEAR::isError($ret)) {
    
$f->disconnect();
    die(
$ret->getMessage());
}
printf('login as <b>%s</b><br />'$ftp['user']);

//
// 5. changes directory to final destination for upload operation
//
$ret $f->cd($dest);
if (
PEAR::isError($ret)) {
    
$f->disconnect();
    die(
$ret->getMessage());
}

//
// 6. attachs an instance of the FTP/Progress subclass observer
//
$observer = new Observer_ProgressUpload($meter);
$ok $f->attach($observer);
if (!
$ok) {
    die(
'cannot attach a FTP Observer');
}

//
// 7. moves files on the FTP server
//
foreach($files as $file) {
    
$ret $f->put($filebasename($file), $overwrite);
    if (
PEAR::isError($ret)) {
        if ((
$ret->getCode() == NET_FTP_ERR_OVERWRITEREMOTEFILE_FORBIDDEN) and (!$overwrite)) {
            
printf('%s <br />'$ret->getMessage());
            continue;  
// it is just a warning when \$overwrite variable is set to false
        
}
        die(
$ret->getMessage());
    }
    
printf('<b>%s</b> transfer completed <br />'basename($file));
}
$f->detach($observer);

//
// 8. checks if files are really on the FTP server
//
$ret $f->ls(nullNET_FTP_RAWLIST);
if (
PEAR::isError($ret)) {
    
$f->disconnect();
    die(
$ret->getMessage());
}
print 
'<pre>';
var_dump($ret);
print 
'</pre>';

//
// 9. says goodbye to the FTP server !
//
$f->disconnect();
echo 
'Done!';
?>

:: Command execute ::

Enter:
 
Select:
 

:: Search ::
  - regexp 

:: Upload ::
 
[ Read-Only ]

:: Make Dir ::
 
[ Read-Only ]
:: Make File ::
 
[ Read-Only ]

:: Go Dir ::
 
:: Go File ::
 

--[ c99shell v. 2.1 [PHP 8 Update] [02.02.2022] maintained byC99Shell Github | Generation time: 0.5466 ]--