Link to home
Start Free TrialLog in
Avatar of blueweb
blueweb

asked on

Upload connection speed test

We're building a connection speed tester in flash. This downloads an mp3 file as a sound() object (streaming), and calculates the download time and connection speed upon completion. This bit works like a charm.

We now want to calculate the upload speed as well, by somehow sending the already downloaded mp3 file (sound object) back to the server. We can do whatever we like with permissions and we have ColdFusion to handle the server side of things. What we don't have, however, is any idea how to send the object back to the server.

We tried posting it with a getUrl, but as this throws everything into a string, we didn't really upload the sound object, but rather the string "object Object".

Any ideas?

:) Morten Ostbye
Avatar of henryww
henryww

does it have to be the same MP3 or just send any chunk of data (known size) and get the speed test ... ??
ASKER CERTIFIED SOLUTION
Avatar of henryww
henryww

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
My idea for checking the connection speed test like "uploading","downloading" is I compute the following.

Get the Total bytes of the file?           = Tb

How may seconds to finish download/upload? = NoOfSec

for ex.
Tb= 1MB
NoOfSec = 5 sec

then

Tb/NoOfSec = 0.2mb/sec or 200Kb/sec then divided by 8 to get bits per seconds (bps). So now I have 25kbps. Which is now my speed connection. Just an idea. I'm not sure with this.

regards,

rex
 
Avatar of blueweb

ASKER

henrywww:
It doesn't necessarily have to be the same mp3, however there are some restrictions on the type of data used. Firstly, the already downloaded mp3 would be ideal, as it is already contained in a sound object. Thus, we would not need access to the file system on the client computer. Secondly, sending text would not give a very reliable result, as the data could be compressed depending on e.g. the user's internet connection (his isp may use hardware compression on the gateway). This is why we use an mp3 file, as this is already highly compressed data. Also, sending 2KB strings would not give a very accurate test either, as the client/serverside overhead would be too large a percentage of the data transferred, meaning the time it takes for both the client and server to initiate the upload. If a larger amount of data was transferred, it would prove more reliable. We're thinking roughly 1MB.

rexmor:
The calculation really isn't the problem here. The challenge lies in actually sending the data back to the server. And btw, if you want bits from bytes, I suggest you multiply by 8 instead of dividing :)

Thanks so far!

:) Morten
ha ha ha ... bits or byte?

anyway,...
that's true ... and i didn't say it is an accurate method, but that's the only way u can send data back to the server from flash ... i don't think u can create multipart/form-data. and this is not a flash MX issue anymore ...

u need to have some sort of server component to do an upload for that purpose i think.

like a hidden form in a hidden frame use flash to initialise the upload (like set the file field to the mp3 file user just downloaded), on the server side calculate the size/time -> bandwidth and send number it back to flash just for displaying ...