Say the maximum width of your CSS for the progress bar (DIV?) Is 770px. Name this PROGRESS_MAX.
If the file size in bytes is FILE_SIZE and the number of bytes downloaded is UPLOADED_BYTES, then the current progress value (width in pixels) is UPLOADED_BYTES / FILE_SIZE * PROGRESS_MAX
Hope you are looking.
source share