Upload connection speed test

Posted on 2003-03-13
Medium Priority
Last Modified: 2010-04-03
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
Question by:blueweb
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3

Expert Comment

ID: 8129846
does it have to be the same MP3 or just send any chunk of data (known size) and get the speed test ... ??

Accepted Solution

henryww earned 800 total points
ID: 8130615
ok ... this is what i do.
again using LoadVars()

send chunks of 2048 byte string to the server using sendAndLoad, say for ten 10 times

average the time taken for each send. it will give u a rough speed test not very accurate though.

do think that's ok.

if so i can work out the sample code for u ... it seems to work ok when i tested briefly on my local machine.

Expert Comment

ID: 8132966
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


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.



Author Comment

ID: 8134686
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.

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

Expert Comment

ID: 8135022
ha ha ha ... bits or byte?

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 ...


Featured Post

Enroll in August's Course of the Month

August's CompTIA IT Fundamentals course includes 19 hours of basic computer principle modules and prepares you for the certification exam. It's free for Premium Members, Team Accounts, and Qualified Experts!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Sometimes you know that one object has a specific child in it, but you can't find the child. This happened to me when I was trying to code some actionScript to make a toolbar work with its embedded buttons.  My partner had created the toolbar usi…
The last time I worked with Flash and Socket connections was in AS1. A recent project required flash connecting to a Socket, and sending receiving information - we figured it would be easy enough - we all know about the socket policy documents and c…
In this tutorial viewers will learn how to create a basic motion tween animation in Flash Open a new document in Flash: Draw/import an image: Press CTRL + F8 to convert it into a graphic symbol: Select a frame (how long you want the tween to last): …
The goal of the tutorial is to teach the user how to select the video input device. Make sure you have an input device that in connected and work and recognized by Adobe Flash Media Live Encoder and select it in the “video input” menu.

765 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question