I am trying to implement a bandwidth test, and it seems that the most common way to do this is to basically transfer one or more images between the client and server and see that the download and download times.In fact, this answer already covers the idea of โโgetting the download time.
At this point, I'm not too sure how to make the process in both directions, with or without using a different answer. Even after adding the debug instructions, I could not find where the image data is stored in another answer. And if I try to start from scratch, most of the API information I find on the Internet / Stack about sending images back and forth has very little explanation or elaboration, so I can't use it put them together. In addition, some of the experiments that I put together that sometimes included other platforms seemed to really reduce bandwidth usage and also reduce the delay with image sizes.
Using JavaScript, how do you transfer the same image back and forth between the client and server so that you can accurately use the delay and image size to measure the bandwidth? How to do this work in both ways with the same image without throttling and without user interaction?
EDIT
I could try to post what I tried, but it's hard for him to make sense. There was a lot in Flash. When I start using JavaScript, I started experimenting a bit on these lines:
$.get('http://ip address/test.php?filename=XXX&data=LONG STRING OF DATA REPRESTING THE DATA TO BE SAVED PROBABLY LESS THAN 2K IN SIZE AND ALSO YOU SHOULD ESCAPE OR ATLEAST URIENCODE IT', function(data) { alert('here') eval(data); });
PHP file:
<?php echo "response=here"; ?>
And I used the PHP file for both Flash and JavaScript. I also used Adobe Media Server with Flash. But moving from a 1 MB file to a 32 MB file when using Flash / PHP, Flash will only scale the delay 10 times, somewhere close to 32. It also seemed to reduce bandwidth usage, at least when paired with AMS, and possibly even when it was paired with a PHP file.
I was going to convert the JavaScript code to pass the actual image into a PHP file ... but I can't get to it. Even when I do things like:
for (var s in download) { alert(s + ": " + download[s]); }
download is an object loading an image in JavaScript (see the related answer for the code), I don't see anything useful. download.children.length is 0, etc. I also reluctantly believe that the results do not limit the use of bandwidth, as experiments with Flash, without further confirmation; perhaps the image should be transferred using one type of API call or another in order to make it work correctly?
In essence, I'm really looking for good API information. The other things I saw were simply not complicated enough to connect the dots.
2ND EDIT
One of the issues that I have encountered is using POST to upload images. I ran into great difficulties in getting IIS 7 to allow POST to load arbitrary file types (namely jpg) with "unusual" binary characters and so that they were more than 2 MB.