I am writing an application which detects the bandwidth of the Client machine. A new requirement needs me to detect both the upload andd download speeds seperately. Is this possible. Please guide me through the process.
Thanks in Advance.
The FileReference class can upload a file and has events for progress to handle the upload.
The URLLoader can perform the download and give you the progress events.
Just monitor a quick upload and download with the progress events. Average the speed as you get events and you'll know the approximate speed. The longer the upload or download the more accurate you'll be but also waste more bandwidth doing it. If this is for a device then be careful about using too much data and I'd do it once and never again if possible. If it's a desktop computer it's potentially less of an issue but the user can still be tethered to a cell via a laptop.
Yes the user chooses a file of any size to perform the test. You'd have to do that to use the easy upload method of FileReference as it won't work until browse is invoked.
I didn't know you needed to do it silently but if you do want to you can always download a file first from your server using URLLoader. Then once you have it loaded in flash you can re-send that same file back on a lower level using the Socket class. This isn't really something easily explained here but take a look at the class:
You can send the same data you downloaded right back to something using that class to something like a FTP server. This is a pretty common thing and there's lots of examples online about uploading files to a FTP server using the Socket class.