Workaround for PHP+APC implementation of upload progress bar and not displayed under IE7 _php tutorial

Source: Internet
Author: User
Tags apc
Today, I have written about the upload of files, and display the progress bar of the program code, the code to optimize the collation. Solved the problem that has been troubled: Sometimes the progress bar does not reach 100%, the browser appears suspended animation phenomenon. The IE8, chrome test is perfect.

Project requirements:

Upload apk, display the upload progress bar, upload completed to start analysis apk, and show: is analyzing the APK data, please later ..., after the analysis is complete, display: Upload successful, re-upload

Because my computer is installed WinXP English version, ie default is IE7, in the test when the progress bar is not shown. The percentages are also not displayed.

Troubleshooting Issues:

1. Change DOM to jquery mode, not show

2, the recursive call plus delay, do not display. Plus the delay code: SetTimeout ("getprogress ('" +upid+ "')", 500);

3, is the container level problem caused? It then tests whether the module was executed during the upload. Add a container to the page, write a global variable I, write to the container in the module that was called during the upload i++, show that the correct call

4, that is, the progress bar and percentage are 0, is not the JSON data received a problem?

Because my return code is: Echo Json_encode ($arr); JSON data itself, but to find out why, the returned data is executed once: Var dataobj=eval ("(" +data+ ")");//Convert to JSON object

A script error is displayed.

5, is it a cache? So will
Copy the Code code as follows:
$.getjson ("processbar.php", {progress_key:upid},function (result) {

Switch
Copy the Code code as follows:
$.getjson ("processbar.php", {progress_key:upid,time: (new Date ()). GetTime ()},function (result) {

solve the problem perfectly.

http://www.bkjia.com/PHPjc/326784.html www.bkjia.com true http://www.bkjia.com/PHPjc/326784.html techarticle today, I have written about the upload of files, and display the progress bar of the program code, the code to optimize the collation. Solves the problem that has been troubling: Sometimes the progress bar does not reach ...

  • 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.