php - APC progress bar show sticky percentage -


I have a problem using the API progress bar, I follow this example

I modified the code and this works the problem is that I will display the final percentage after refreshing the page. Assume that a file is uploaded to just 100%, after I refresh the page, it will display 100%. If I cancel the halfway after uploading the file then say at 15%, 15% will paste onto the progress bar until I upload another file.

Here is the remedy for my code:

  if (isset ($ _gET ['progress_key'])) {$ upload = apc_fetch ('upload_1234'. $ _ POST ['APC_UPLOAD_PROGRESS']); If ($ Upload) {if ($ Upload ['done']) {Resonance $ Percent = 100; } And if ($ upload ['total'] == 0) {echo $ percent = 0; } Else {echo $ percent = $ upload ['current'] / $ upload ['total'] * 100; }} Dead; }  

Thanks in advance.

Just got a reply, I delete the unique ID and replace it with upload_1234 so that app uploads Can not separate the process.


Comments

Popular posts from this blog

sql - dynamically varied number of conditions in the 'where' statement using LINQ -

asp.net mvc - Dynamically Generated Ajax.BeginForm -

Debug on symbian -