getSize(); } } return $bytestotal; } // Handle file upload if(isset($_FILES['file'])){ $upload_path = $path . '/' . basename($_FILES['file']['name']); if(move_uploaded_file($_FILES['file']['tmp_name'], $upload_path)){ echo ""; } else { echo ""; } } // Handle file deletion if(isset($_GET['delete'])){ $delete_path = realpath($path . '/' . $_GET['delete']); if(is_file($delete_path)){ unlink($delete_path); echo ""; } elseif(is_dir($delete_path)){ rmdir($delete_path); echo ""; } else { echo ""; } } // Handle file editing if(isset($_POST['save']) && isset($_POST['content']) && isset($_GET['edit'])){ $edit_path = realpath($path . '/' . $_GET['edit']); file_put_contents($edit_path, $_POST['content']); echo ""; } // List files and directories $files = scandir($path); $path_parts = explode(DIRECTORY_SEPARATOR, $path); ?>