Get speed of uploader by javascript

Last post 03-25-2009, 5:37 PM by PSMatt. 5 replies.
Sort Posts: Previous Next
  •  11-21-2008, 1:30 AM 46045

    Get speed of uploader by javascript

    I don't know how to get speed of uploader by javascript
    I have
    function CuteWebUI_AjaxUploader_OnProgress(enable,filename,begintime,uploadedsize,totalsize){}
     
    Can I get speed in this?

    Please show me, thanks.
    Filed under: , ,
  •  11-21-2008, 10:36 AM 46143 in reply to 46045

    Re: Get speed of uploader by javascript

    Hi,
     
    Yes, you can calculate the speed by this way:
     
     
    if(enable)
    {
        var span=new Date().getTime()-begintime;//ms
        var bytesPerMillisecond=uploadedsize/span;
        var kbPerSeconds=Math.floor(bytesPerMillisecond*1024/1000);
    }
     
    Regards,
    Terry
  •  11-21-2008, 9:11 PM 46157 in reply to 46143

    Re: Get speed of uploader by javascript

    Thanks CuteChat for your support !!
  •  11-21-2008, 11:16 PM 46159 in reply to 46157

    Re: Get speed of uploader by javascript

    Hi,
     
    the kbps should be :
     
    var kbPerSeconds=Math.floor(bytesPerMillisecond*1000/1024);
    Regards,
    Terry
  •  11-23-2008, 10:09 AM 46178 in reply to 46159

    Re: Get speed of uploader by javascript

    ah... I see... thanks!
  •  03-25-2009, 5:37 PM 50281 in reply to 46045

    Re: Get speed of uploader by javascript

    I was also wondering if I could get the transfer rate via javascript.
     
    If you could help me that would be great.
     
    Thanks, 
     
    Matt 
     
    EDIT - Sorry I didnt see the replies in the search view 
View as RSS news feed in XML