HEX
Server: Apache/2.4.54 (Win64) OpenSSL/1.1.1q PHP/8.1.10
System: Windows NT ALTAIR 10.0 build 20348 (Windows Server 2022) AMD64
User: Administrator (0)
PHP: 8.1.10
Disabled: NONE
Upload Files
File: C:/laragon/www/dropbymatte/stream.php
<?php
require 'config.php';

$id = $_GET['id'] ?? '';
$password = $_GET['password'] ?? '';

if (!$id || !$password) {
    http_response_code(403);
    exit;
}

$stmt = $pdo->prepare("SELECT filepath, file_password FROM files WHERE id = ?");
$stmt->execute([$id]);
$file = $stmt->fetch();

if ($file && password_verify($password, $file['file_password'])) {

    // 🔥 PATH ASSOLUTO SICURO
    $fullPath = __DIR__ . '/' . $file['filepath'];

    if (file_exists($fullPath)) {

        $ext = strtolower(pathinfo($fullPath, PATHINFO_EXTENSION));
        $mime = ($ext === 'mp3') ? 'audio/mpeg' : 'audio/wav';

        header("Content-Type: $mime");
        header("Content-Length: " . filesize($fullPath));
        readfile($fullPath);
        exit;
    }
}

http_response_code(404);
exit;