I am creating a speed test application which measures a users upload and download speed by timing how long it takes to upload and download various files. At the moment I am using Javascript to download an image from an external server using the following code:
var start_time,end_time;
var download = new Image();
download.onload = function () {
end_time = (new Date()).getTime();
download_duration = (end_time - start_time) / 1000;
finish_download_test();
}
start_time = (new Date()).getTime();
download.src = 'www.fakeimage.com/image.jpg';
This works, however, I would like to display a progress bar whilst the image downloads. I have seen html5 and c# solutions, however, I would like something that is compatible for more browsers (so no html5) and I am using a combo of php and javascript so the c# solution doesnt help either.
Any help would be greatly appreciated, even if it was just a nudge in the right direction.