How can the Content-Disposition header be adjusted to display PHP-generated images directly in the browser without prompting for download?
When serving PHP-generated images, the Content-Disposition header can be adjusted to inline instead of attachment to display the image directly in the browser without prompting for download. This can be achieved by setting the Content-Disposition header to "inline" in the PHP code before outputting the image.
<?php
// Set the Content-Disposition header to inline
header('Content-Disposition: inline');
// Output the image
header('Content-Type: image/jpeg');
readfile('path/to/your/php-generated-image.jpg');
?>