I'm using this code to output a file on uuser web browser.
header("Content-Type: image/png");
header("Content-Disposition: inline; filename=".$file_name.".png;");
echo file_get_contents('data:image/png;base64,'. $file_content);
This works fine in my localhost docker environment, but in EC2 it shows weird chars (like picture below).
Am I doing something wrong?
question from:https://stackoverflow.com/questions/65835562/php-show-png-image-in-browser-works-in-localhost-but-not-on-aws