Home >Backend Development >PHP Tutorial >Solution to the problem of using php+apc to implement the upload progress bar and not displaying it in IE7_PHP Tutorial
Today I will sort out the program code that I wrote before about uploading files and displaying the progress bar, and optimize and organize the code. Solved the problem that has been bothering: sometimes the progress bar does not reach 100%, and the browser appears suspended. The test in IE8 and chrome is perfect.
Project requirements:
Upload the APK and display the upload progress bar. After the upload is completed, the APK will be analyzed, and it will display: Analyzing apk data, please wait... After the analysis is completed, it will display: Upload successful, re-upload
Since my computer is installed with the English version of winxp, the default IE is IE7. During the test, I found that the progress bar was not displayed. The percentage is not displayed either.
Troubleshooting:
1. Change the DOM to jquery mode without displaying
2. Add a delay to the recursive call and do not display it. Add the delay code: setTimeout("getProgress('"+upid+"')",500);
3. Is it caused by a container-level problem? So test whether to execute the upload period module. Just add a container to the page, write a global variable i, and write it to the container i++ in the module called during the upload. It will display and indicate the correct call
4. Now that the progress bar and percentage are both 0, is there something wrong with the json data received?
Since the code I returned is: echo json_encode($arr); itself is json data, but in order to find out the reason, I will execute the returned data once: var dataObj=eval("("+data+")" );//Convert to json object
Show script errors.
5. Is it cache? So copy the code
http://www.bkjia.com/PHPjc/326784.html