flash 8 file upload, tracking up/down rate?
January 7th, 2009Thanks
Paul
If you are not minding your ftp username/password will be stolen because of some "decomplier" user....sure it can.....
admin penal.....Flash cannot do anything alone,you should trying to make it with other scripting(php,asp,cgi etc.)
Nice one :>
http://ag0609.ecpocket.com/test/main.html
Thanks
average rate (kbyes/second) = kbytes downloaded so far / time (seconds)
To find the time you could use the _root.getTimer() method (which returns milliseconds btw), set a variable to keep a start time when you start downloading/uploading the file and then use this to find the current time elapsed:
time elapsed (seconds) = (start time - getTimer())/1000
Hope this helps, repost if you are still having trouble.
http://ag0609.ecpocket.com/test/main.html
Thanks
um......I will post within tomorrow(<----time zone may not the same)....
Is it possible to make ftp: contact with this function? so I could make a flash admin panel?
If you are not minding your ftp username/password will be stolen because of some "decomplier" user....sure it can.....
admin penal.....Flash cannot do anything alone,you should trying to make it with other scripting(php,asp,cgi etc.)
http://ag0609.ecpocket.com/test/main.html (<---chinese)
Just select the item in the list of left-hand-side and select "test.part6.rar" in the list of right-hand-side,then ticked all check boxes.at final click "Download" of the botton-right.
FF work perfectly,but IE got bug with cache.umm.. the zip's dont seem to be downloading... can you upload it here for me, please?
anyway, i'll give this a try. 謝thanks!
http://ag0609.ecpocket.com/test/main.html (<---chinese)
Just select the item in the list of left-hand-side and select "test.part6.rar" in the list of right-hand-side,then ticked all check boxes.at final click "Download" of the botton-right.
FF work perfectly,but IE got bug with cache.
Math is not my strongest quality
OK,here you are(<----not translate to English yet...but I add some instruction in English with it)
Not for Download now
Can't download it? Strange....I got test with 5 computers(with win2000, winServer2003, winXP SP1/SP2).They didn't install special software(FP8 and nod32 installed)....
It works:
http://ag0609.ecpocket.com/work.jpg
umm....just ignored this.Try to take look of my transfer speed code:
listener.onProgress = function(file:FileReference, bytesLoaded:Number, bytesTotal:Number):Void {
//trace("onProgress with bytesLoaded: " + bytesLoaded + " bytesTotal: " + bytesTotal);
bL = bytesLoaded;
bT = bytesTotal;
per = bytesLoaded/bytesTotal*100;
if (old == undefined) {
speed = 0;
old = 0;
markspeed = setInterval(function () {
speed = bL/1024-old;
old = bL/1024;
}, 1000);
}
if(speed.toString() == "NaN" speed == undefined speed < 0) {
speed == 0;
}
loadbar.label = "Uploading..."+Math.floor(per)+"% "+Math.floor(speed)+"Kb/sec";
};
I am using "new loaded" -" old loaded".Becuz I think using average speed will got wrong speed when some part of file have been cached.
#If you have any other info about this subject , Please add it free.# |