Search code examples
actionscript-3apache-flexprogress-barflex4flex4.5

Flex 4 Progress bar Show Minutes are left


I upload a file on server and the progress is showing through progress bar. When i upload the file in flex 4 how can i calculate the time that how many minutes are left when we upload the file on server.

Please if anyone has any idea please share.

Thanks


Solution

  • I am not very sure this can be determined with consistency and accuracy . You can do one thing , once the upload starts get hold of the time and at each interval calculate the amount of file transferred x bytes and the corresponding time t seconds . Then the upload speed will be around x/t bytes/second . Let say the total size is total bytes , then the time remaining will be (total-x)/(x/t) .

    If you want to use some ready made custom component look at this.