Using PHP+APC to implement upload progress bar and do not display under IE7 problem solving method _php Skills

Source: Internet
Author: User
Tags apc

Today to organize the previous written on the upload file, and show the progress bar of the program code, the code to optimize the collation. Solved the problem has been puzzling: Sometimes the progress bar does not reach 100%, the browser appeared suspended animation phenomenon. In IE8, the chrome test is perfect.

Project requirements:

Upload apk, show upload progress bar, upload finish start Analysis apk, and show: Analyzing APK data, please later ..., after analysis, show: Upload successfully, upload again

Because my computer installed is WinXP English version, ie default is IE7, in the test time found the progress bar does not show. Percentages are also not displayed.

Troubleshooting Issues:

1, change the DOM to jquery mode, do not show

2, to recursive calls plus delay, do not display. Plus delay code: settimeout ("getprogress (' +upid+") ", 500);

3, is the container level problem caused? The test is then performed to perform the upload period module. Add a container to the page, write a global variable I, write to the container i++ in the module called during the upload, and show that the correct call

4, that is, the progress bar and the percentage is 0, is not receiving the JSON data problem?

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

Displays script errors.

5, is it a cache? So will

Copy Code code as follows:

$.getjson ("processbar.php", {progress_key:upid},function (result) {

To
Copy Code code as follows:

$.getjson ("processbar.php", {progress_key:upid,time: (new Date ()). GetTime ()},function (result) {

Perfect solution to the problem.

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.