Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

Upload connection speed test

Posted on 2003-03-13
6
Medium Priority
?
215 Views
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
0
Comment
Question by:blueweb
  • 3
5 Comments
 
LVL 6

Expert Comment

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

Accepted Solution

by:
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.
0
 
LVL 9

Expert Comment

by:rexmor
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

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
 
0
 

Author Comment

by:blueweb
ID: 8134686
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
0
 
LVL 6

Expert Comment

by:henryww
ID: 8135022
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 ...



0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

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

Introduction This article is primarily concerned with ActionScript 3 and generally specific to AVM2.  Most suggestions would apply to ActionScript 2 as well, and I've noted those tips that differ between AS2 and AS3. With the advent of ActionS…
Recently, I was asked to recommend a tracking system to be implemented on a clients website. As the entire site was built on flash, my first thought was to suggest custom built tracking system. However, our company at that point of time didn't h…
In this tutorial viewers will learn how to create a basic shape tween animation in Flash including shape hints for smooth animation Open a new document in Flash: Draw a shape: Select another frame (how long you want the tween to be): Right click and…
The goal of the tutorial is to teach the user how to select which audio input to use. Once you have an audio input plugged into the laptop or computer, you will go into the audio input settings and choose which audio input you want to use.
Suggested Courses

571 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