When I use php to generate some images (without a suffix, it is actually a PNG file), I am prompted to download the images instead of directly displaying the images when reading the images using URLs (loading normally through tags ), how can I set it to display images directly instead of downloading images.
I used php to generate some images (without a suffix, it is actually a PNG file)
When reading with a URL, the system prompts me to download the image instead of directly displaying the image (loading normally through the tag). How can I set it to display the image directly instead of downloading it.
Reply content:
I used php to generate some images (without a suffix, it is actually a PNG file)
When reading with a URL, the system prompts me to download the image instead of directly displaying the image (loading normally through the tag). How can I set it to display the image directly instead of downloading it.
Nginx add_header.
Location/images/{add_header content-type "image/png ";}
There is an ngxHeadersMore nginx extension, you can modify the response header to change the response of your image request to the Content-Type of the response
Location/png {moreSetHeaders 'content-Type: image/png ';}