0

How do I get the upload speed (bitrate) (i.e. kb/s, mb/s, etc) for uploads issued by an XHR request?

The Internet
  • 7,959
  • 10
  • 54
  • 89
  • Use the XHR2 `onprogress` event to get the amount of data uploaded, and divide by the time taken. –  Nov 05 '13 at 08:43
  • That worked, thanks. I'm dividing the delta of the data loaded, by the delta of the amount of time elapsed, from the previous callback to the current callback. time = formatFileSize ((evt.loaded - prev) / ((end - start) / 1000)) + '/s'; – The Internet Nov 05 '13 at 09:50

0 Answers0