phppngteamspeak

Teamspeak Hostbanner doesn't work with PHP File


I'm having a PHP file that is imitating a PNG file by setting the mime-type to image/png.

Thanks to a .htaccess-file that I have, I can access my image in these ways:

and all of them are working well in my browser, but they don't load on my Teamspeak server.


Solution

  • Thanks to @gview's answer I found out that Cloudflare was protecting the /img/ folder, so I made a page rule to stop this. Just in case you need it, this now is my script and it sets the correct headers:

    # Generate $im and Stuff
    # ...
    
    # Now Output it
    http_response_code(200);
    $file = "./temp.png";
    imagepng($im, $file);
    header("Content-Type: image/png");
    header("Content-Length: ".filesize($file));
    readfile($file);
    exit;