<?php
if (isset($_GET['file'])) {
    $file = basename($_GET['file']);
    $filepath = __DIR__ . '/' . $file;
    
    if (file_exists($filepath)) {
        header('Content-Type: image/png');
        header('Content-Disposition: attachment; filename="' . $file . '"');
        header('Content-Length: ' . filesize($filepath));
        readfile($filepath);
        exit;
    }
}
header('HTTP/1.0 404 Not Found');