*/ /* This software came from http://webphpftp.sourceforge.net/ */ /* Copyright (c) 2006 Leandro Martinez. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 3. The name of the author may not be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* PHPFTP License */ /* $Id: ftp.php,v 2.2 2002/03/12 23:21:28 pauls Exp $ */ /* This software came from http://inebria.com/ */ /* Copyright (c) 2000 Paul Southworth. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 3. The name of the author may not be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* ============================================================= */ /* End license stuff */ /* ============================================================= */ $phpftp_version = "0.1"; $show_version_footer = 1; /*Human-readable bytes size function*/ function size_readable($size, $unit = null, $retstring = null) { // Units $sizes = array('B', 'KB', 'MB', 'GB', 'TB'); $ii = count($sizes) - 1; // Max unit $unit = array_search((string) $unit, $sizes); if ($unit === null || $unit === false) { $unit = $ii; } // Return string if ($retstring === null) { $retstring = '%01.2f %s'; } // Loop $i = 0; while ($unit != $i && $size >= 1024 && $i < $ii) { $size /= 1024; $i++; } return sprintf($retstring, $size, $sizes[$i]); } /*Header*/ function phpftp_top() { global $phpftp_version; ?> Web FTP

 

This is WebFTP version based on PHP FTP of inebria software.

 

.: Welcome to Web FTP. Please login :.
Hostname:
Username:
Password:

Could not establish FTP connection. Re-login? Could not access directory.

"; if ($phpftp_dir == "/") { $phpftp_dir=""; } if ($contents = ftp_rawlist($ftp,$phpftp_dir)) { $d_i=0; $f_i=0; $l_i=0; $i=0; while ($contents[$i]) { $item[] = split("[ ]+",$contents[$i],9); $item_type=substr($item[$i][0],0,1); if ($item_type == "d") { /* it's a directory */ $nlist_dirs[$d_i]=$item[$i][8]; $d_i++; } elseif ($item_type == "l") { /* it's a symlink */ $nlist_links[$l_i]=$item[$i][8]; $l_i++; } elseif ($item_type == "-") { /* it's a file */ $nlist_files[$f_i]=$item[$i][8]; $nlist_filesize[$f_i]=$item[$i][4]; $f_i++; } elseif ($item_type == "+") { /* it's something on an anonftp server */ $eplf=split(",",implode(" ",$item[$i]),5); if ($eplf[2] == "r") { /* it's a file */ $nlist_files[$f_i]=trim($eplf[4]); $nlist_filesize[$f_i]=substr($eplf[3],1); $f_i++; } elseif ($eplf[2] == "/") { /* it's a directory */ $nlist_dirs[$d_i]=trim($eplf[3]); $d_i++; } } /* ignore all others */ $i++; } ?> Could not connect to FTP. ERROR:phpftp_mkdir:phpftp_connect

Re-login? Could not connect to FTP. ERROR:phpftp_get:phpftp_connect

Re-login? Could not connect to FTP. ERROR:phpftp_get:ftp_get

Re-login? Could not connect to FTP. ERROR:phpftp_delete:phpftp_connect

Re-login? Could not connect to FTP. ERROR:phpftp_delete:phpftp_connect

Re-login? Could not connect to FTP. ERROR:phpftp_get:phpftp_connect

Re-login? Could not connect to FTP. ERROR:phpftp_get:ftp_get

Re-login?

0) { ?> 0) { ?> ".$parsed[$i]['name']; //echo $parsed[$i]['size']; $totalspace += $parsed[$i]['size']; $i++; } } echo "
Used space on directory:". size_readable($nlist_total) . "
"; echo "
Used space on server:". size_readable($totalspace) ."
"; } } else { ?>
Directories

Directories

Files

Directory empty.

Directory
Files


Could not connect to FTP. ERROR:phpftp_put:phpftp_connect

Re-login? Could not connect to FTP. ERROR:phpftp_put:move_uploaded_file

Re-login?? Could not connect to FTP. ERROR:phpftp_put:phpftp_connect

Re-login?