How to solve the problem that the upload progress bar is not displayed in IE7 using php + apc

Source: Internet
Author: User
Tags apc

Today, I sorted out the program code about uploading files and displaying the progress bar, and optimized the code. Solve the problem that has been plagued: Sometimes the progress bar does not reach 100%, and the browser is suspended. The tests in IE8 and chrome are perfect.

Project requirements:

Upload APK. the upload progress bar is displayed. After the upload is complete, start to analyze the APK. The apk data is being analyzed. Please wait.... After the analysis is complete, the APK data is uploaded successfully and uploaded again.

Since I installed winxp in English and IE in IE7 by default, I found that the progress bar was not displayed during the test. The percentage is not displayed.

Troubleshooting:

1. Change DOM to jquery mode and do not display

2. Add a delay to the recursive call without display. Add the latency code: setTimeout ("getProgress ('" + upid + "')", 500 );

3. Is it caused by a container level problem? Therefore, the module is tested whether to perform the upload process. Add a container on the page, write a global variable I, and write it to the container I ++ in the module called during the upload. The result is displayed, indicating that the container is called correctly.

4. If the progress bar and percentage are both 0, is there a problem with the received json data?

Because the returned code is echo json_encode ($ arr); It is json data, but to find out the cause, the returned data is executed once: var dataObj = eval ("(" + data + ")"); // convert to a json object

The script error is displayed.

5. Is it a cache? Therefore
Copy codeThe Code is as follows:
$. GetJSON ("ProcessBar. php", {progress_key: upid}, function (result ){

Changed:
Copy codeThe Code is as follows:
$. GetJSON ("ProcessBar. php", {progress_key: upid, time :( new Date (). getTime ()}, function (result ){

Perfect solution.

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.