title: Calculate upload speed
body: <p>Using this code I'm able to calculate my download speed:</p>
  
  <pre><code>var imgAddr = "http://upload.wikimedia.org/wikipedia/commons/2/2d/Snake_River_%285mb%29.jpg" + "?n=" + Math.random();
  var startTime, endTime;
  var download_size = 5*1024*1024;
  var img = new Image();
  img.onload = function () {
      endTime = (new Date()).getTime();
      ShowData();
  }
  startTime = (new Date()).getTime();
  img.src = imgAddr;
  
  function ShowData()
  {
      var duration = (endTime - startTime) / 1000;
      var bitsLoaded = download_size * 8;
      var speedMbps = ((bitsLoaded / duration) / 1024 / 1024).toFixed(2);
      alert("Speed: " + speedMbps + " Mbps");
  }
  </code></pre>
  
  <p><a href="http://jsfiddle.net/7c5Xg" rel="noreferrer">jsfiddle</a></p>
  
  <p>How would I send that same image back to a dummy php (not sure if it would be required to exist a server-side script to "accept" the POST request) in my server to calculate the <strong>upload</strong> speed</p>