Why ie6 does not display dynamic thumbnails

Source: Internet
Author: User

When uploading and generating a thumbnail, the link displayed by the thumbnail is as follows;
Copy codeThe Code is as follows:


The thumbnail is not displayed in ie6. The following code is traced back:
Copy codeThe Code is as follows:
Header ("Content-type: image/jpeg ");
Header ("Content-Length:". strlen ($ _ SESSION ["fileInfo"] [$ image_id]);
Echo $ _ SESSION ["fileInfo"] [$ image_id];
Unset ($ _ SESSION ['fileinfo'] [$ image_id]); //
Exit (0 );

So I wondered if it was unset before the display was too late? The deletion is successful. Later changed to the following code:
Copy codeThe Code is as follows:
Header ("Content-type: image/jpeg ");
Header ("Content-Length:". strlen ($ _ SESSION ["fileInfo"] [$ image_id]);
Echo $ _ SESSION ["fileInfo"] [$ image_id];
/** Output the above session immediately. The thumbnails generated in ie6 are cleared by the unset ($ _ SESSION ['']) below before they are displayed, as a result, ie6 cannot display thumbnails */
Echo $ str. str_repeat ('', 256); // Some browsers must output up to 256 characters
Ob_flush ();
Flush (); // both must be used together.
Unset ($ _ SESSION ['fileinfo'] [$ image_id]); //
Exit (0 );

In fact, this leads to the problem of server Output Control and browser cache, which is a bit complicated and will be studied again later.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.