Today I found very strange 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 the only option was 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 needed sessions! Solution was very simple: it was necessary to add following lines before image output:
1 2 3 | header("Cache-Control:"); header("Pragma:"); header("Set-Cookie:"); |
These lines will clear all headers sent by session_start() function and IE will understand that your the image is in right format.
угу, видел такое. но не игрался для устранения ошибки. спасибо за исследование и решение проблемы
Спасибо! Сегодня наткнулся и был очень рад, что знаю, где брать ответ. :-)
Very useful and interesting aricle. Can I translate and insert this on my site?
Greetings
Aukcje
Of course you can. Just don’t forget to insert link to original one.
спасибо большое за решение… :)
тоже намучался с этим – наткнулся на ваш пост.
решение есть более элегантное:
session_cache_limiter(‘none’)
session_cache_limiter(’none’)
если можно обьясните новичку