Topbar
Topbar
Sign in
|
Join
|
Client Center
Home
Products
Client Center
Contact
Purchase
Support forums
»
Products
»
Ajax Uploader
»
Re: Get speed of uploader by javascript
Get speed of uploader by javascript
Last post 03-25-2009, 5:37 PM by
PSMatt
. 5 replies.
Sort Posts:
Oldest to newest
Newest to oldest
Previous
Next
11-21-2008, 1:30 AM
46045
jackynguyen
Joined on 11-21-2008
Posts 5
Get speed of uploader by javascript
Reply
Quote
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:
speed
,
uploader
,
javascript
11-21-2008, 10:36 AM
46143
in reply to
46045
cutechat
Joined on 07-22-2004
Posts 2,332
Re: Get speed of uploader by javascript
Reply
Quote
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
jackynguyen
Joined on 11-21-2008
Posts 5
Re: Get speed of uploader by javascript
Reply
Quote
Thanks CuteChat for your support !!
11-21-2008, 11:16 PM
46159
in reply to
46157
cutechat
Joined on 07-22-2004
Posts 2,332
Re: Get speed of uploader by javascript
Reply
Quote
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
jackynguyen
Joined on 11-21-2008
Posts 5
Re: Get speed of uploader by javascript
Reply
Quote
ah... I see... thanks!
03-25-2009, 5:37 PM
50281
in reply to
46045
PSMatt
Joined on 03-13-2009
Posts 9
Re: Get speed of uploader by javascript
Reply
Quote
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