Upload Folder:
uploading in progress
~ drag and drop files here, or use the button below ~
README. * @author Adrian7 (http://adrian.silimon.eu/) * @version 0.7.5 * @package PHPFileBrowser */ //--- Settings, plz don't ignore or you might create a security hole on your server ---// //Here you tell the script to limit access only to users aware of this password. 'none' means no password. define('ADMIN_PASS', '7552525'); //Here you can put a custom format to display dates define('DATE_FORMAT', 'Y-m-d H:i:s'); //Here you can put a virtual dir, (ex.: /~homedir) to properly display files under a virtual directory define('SBVDIR', ''); //--- Settings, hope you did some changes... ---// error_reporting(E_ALL ^ E_NOTICE); session_start(); if ( isset($_POST['yourpass']) and ( $_POST['yourpass'] == ADMIN_PASS ) ) $_SESSION['xfbrowserauth'] = 1; define('SBFILE', basename(__FILE__)); define('SPATH', dirname(__FILE__)); define('SBURL', str_replace("/" . SBFILE, '', str_replace(( '?' . $_SERVER['QUERY_STRING']), "", $_SERVER['REQUEST_URI']))); //force download files with these extensions, ignore if they may be displayed $downloadableExts = array(); //an array of supported playable extensions by browsers $playableExts = array('jpg', 'jpeg', 'gif', 'png', 'apng', 'svg', 'ico', 'wav', 'ogg', 'mp3', 'mp4', 'ogv', 'webm', 'flv', 'swf'); //an array of extensions you might wanna play using a flash swf player. See also flashCfg var below $flashPlayableExts = array('flv', 'avi', 'mpeg'); //an array of files for which the source (contents) of the wile will be displayed $sourceExts = array('txt', 'php', 'js', 'php5', 'htm', 'html', 'xml', 'css', 'md', 'ini', '.htaccess', 'java', 'rb', 'py', 'sql'); //globals $isFile = FALSE; $isHome = FALSE; $isDir = FALSE; $isSearch = FALSE; $isNotFound = FALSE; //message types define('ERROR_MSG', 'error'); define('WARN_MSG' , 'warn'); define('INFO_MSG' , 'info'); /** * Outputs a <p> message tag * @param string $message * @param string $msg_type optional additional element class */ function showmsg($message, $msg_type="warn"){ ?>
= 1073741824) return ( round(($size / 1073741824), 2) . " GB" ); if ($size >= 1048576) return ( round(($size / 1048576), 2) . " MB" ); if ($size >= 1024) return ( round(($size / 1024), 2) . " KB" ); return ($size . ' bytes'); } /** * Formats a timestamp to a human-readable format * @param int $timestamp * @param string $format (optional), default is Y-m-d * @return string */ function fmt_date($timestamp, $format="Y-m-d"){ return date($format, $timestamp); } /** * Finds the value of a PHP configuration directive * @param $var name of the directive * @param bool $parseint (optional), set it to 1 or true in case that directive represents a file size in K (KB), M (MB) or G (GB) and you want the value in bytes * @return bool|int|string */ function env_get_cfg($var, $parseint=FALSE){ $value = @ini_get($var); if($value){ if ($parseint){ $last = substr($value, -1, 1); if ( in_array($last, array('K', 'M', 'G')) ){ $value = intval( substr($value, 0, strlen($value)-1) ); if ( $last == 'K' ) return ($value * 1024); if ( $last == 'M' ) return ($value * 1024 * 1024); if ( $last == 'G' ) return ($value * 1024 * 1024 * 1024); } } return $value; } return FALSE; } /** * Generates an array of directories and files * @param string $path absolute path co the directory * @param bool $subdirectories (optional) * @return array */ function dirtree($path, $subdirectories=TRUE){ $path = rtrim($path, "/"); if ( is_file($path) ) $path = dirname($path); if ( !is_array($tree) ) $tree = array(); $k=0; if ( $handle = @opendir($path) ){ while (FALSE !== ( $file = readdir($handle) ) ){ if ( ( $file == '.' ) or ( $file == '..') ) continue; $node = ( $path . "/" . $file ); $tree[$k] = array('name'=>basename($file), 'path'=>$node); if ( is_dir($node) and $subdirectories ) $tree[$k]['nodes'] = dirtree($node, TRUE); $k++; } } return $tree; } function recursive_remove_directory($directory, $empty=FALSE){ if(substr($directory,-1) == '/'){ $directory = substr($directory,0,-1); } if(!file_exists($directory) || !is_dir($directory)){ return FALSE; }elseif(is_readable($directory)){ $handle = opendir($directory); while (FALSE !== ($item = readdir($handle))){ if($item != '.' && $item != '..') { $path = $directory.'/'.$item; if(is_dir($path)) { recursive_remove_directory($path); }else{ unlink($path); } } } closedir($handle); if($empty == FALSE){ if(!rmdir($directory)){ return FALSE; } } } return TRUE; } function get_file_url($file){ $proto = "http"; $self = str_replace(SPATH, "", $_SERVER['PHP_SELF']); $self = str_replace(SBVDIR, "", $self); $selfdir = trim(str_replace(SBFILE, "", $self), "/"); $file = str_replace(SPATH, "", $file); $file = ("/" . $selfdir . $file); if ( isset($_SERVER['HTTPS']) and ($_SERVER['HTTPS'] and $_SERVER['HTTPS'] != "off") ) $proto = "https"; return ($proto . '://' . $_SERVER['SERVER_NAME'] . $file); } function breadcrumbs($rootname="/"){ $dirname = urldecode($_GET['view']); if( $dirname == "." || $dirname == "/" ){ $path= SPATH; $bdir= ""; }else{ $path = ( SPATH . str_replace(SBVDIR, "", $dirname) ); $bdir= str_replace(SBURL, "", $dirname); } $burl = ""; $chunks = explode("/", trim($dirname, "/")); ?> RecursiveDirectoryIterator class not available!"); $ignorelist = get_ignore_files_list(); $dirname = urldecode($_GET['view']); if( $dirname == "." || $dirname == "/" ){ $path= SPATH; $bdir= ""; }else{ $path = ( SPATH . str_replace(SBVDIR, "", $dirname) ); $bdir= str_replace(SBURL, "", $dirname); } $k=0; if ($handle = opendir($path) ){ while (false !== ($file = readdir($handle)) ){ if ($file != "." && $file != ".."){ $k++; $abspath = (rtrim($path) . "/" . $file); //ignored files if( in_array($abspath, $ignorelist) ) continue; $csscls = ""; $size = ""; $action = "view"; if( is_dir($abspath) ) $csscls = "dir "; if( is_file($abspath) ){ $csscls = "file "; $csscls.= get_file_ext($file); $size = (fmt_filesize( filesize($abspath) ) . " / "); if ( is_downloadable_file($abspath) ) $action = "download"; } if( empty($csscls) ) $csscls = "symlink "; $lastmod = fmt_date(@filemtime($abspath), DATE_FORMAT); $fileurl = ( rtrim($bdir, "/") . "/" . str_replace(SPATH, "", $file) ); $eurl = urlencode($fileurl); $anchor = (SBFILE . '?' . $action .'='. $eurl ); $dlurl = (SBFILE . '?download='. $eurl ); $rmurl = (SBFILE . '?delete='. $eurl ); ?>
Upload Folder:
Wrong password!
Please change your ADMIN_PASS to something else!