Today I found very disagreeable problem with Internet Explorer. I’ve generated GIF-image with PHP GD2 and sent results for client browser. In IE I’ve tried to store picture in my local file system but only option is to save the picture as a .BMP file instead of as a native .gif file! The same problem is described in Microsoft Knowledge Base, but it does not help me.
Then I start playing with PHP and headers and discover very nice gizmo: bug became apparent only when my PHP-script uses session_start(). But I’ve need sessions! Solution is very simple: it was necessary to add following lines before image output:
This lines will clear all headers sent by session_start() function and IE will understand that your the image is in right format.