One way to do this that comes to mind is to create an iframe
with a form
with a textarea
in it, fill the textarea
with a large number of random characters, and then programmatically submit the form. Have the submission response call out to the parent window to say when it completed, and measure the time from submission to completion. You might start with a relatively small payload (so it doesn't take forever on a slow connection) and, if that comes back very quickly, repeat with increasingly large payloads until you're happy with the result. The same sort of thing could be done with ajax, I suppose, not sure why I immediately thought in terms of an iframe
. See my other answer here on Stack Overflow, but think in terms of increasingly large form data instead of download data.
This will give you a very rough measure of upload speed.