IE6 The reason why the dynamic thumbnail is not displayed _php tips

Source: Internet
Author: User
When I upload a thumbnail, the thumbnail shows a link to the following image;
Copy Code code as follows:

< img src = "/index.php?action=sys_upload_showthumb&id=bdc3955470adfb5637a0d1f517eb3d35"/>

The result does not show the thumbnail in IE6, and then goes back to the following code:
Copy Code code 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 think it's too late to show it was unset? So the deletion was successful. It was later changed to the following code:
Copy Code code as follows:

Header ("Content-type:image/jpeg");
Header ("Content-length:" Strlen ($_session["FileInfo"] [$image _id]);
echo $_session["FileInfo" [$image _id];
/** immediately output the session above, solve the IE6 under the generated thumbnail has not been shown before has been unset ($_session[']) empty, resulting in IE6 can not show the situation of thumbnails * *
Echo $str. Str_repeat (', 256); Some browsers will not output until the output reaches 256 characters
Ob_flush ();
Flush (); These two must be used in one piece.
unset ($_session[' fileInfo '] [$image _id]);
Exit (0);

In fact, this leads to the server's output control and browser caching problem, which is a bit complicated, and then have the opportunity to study.

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.