Flash上传进度
我正在闪存中进行带宽测试,我想显示进度条和当前计算的速度。对于下载部分来说,这非常简单,但对于上传部分来说,这就有点棘手了。 据我了解,跟踪上传进度的唯一方法是使用 FileReference。但当我上传动态生成的 ByteArray 时,似乎 FileReference 也不可用。
所以我的一个想法是上传一个 100-200 kB 的 ByteArray,并计算该上传的速度,然后在上传更大的 ByteArray 时根据该速度伪造一个进度条。但话又说回来,在某些情况下它可能会偏离很远,计算当前的速度会很困难。
所以我需要一些关于如何解决这个问题的想法:)
I'm making a bandwidth test in flash, and I want to display a progress bar and the current calculated speed. For the download part this is pretty straightforward, but for the upload part it gets a bit trickier.
As I've understood the only way to track upload progress is by using FileReference. But as I'm uploading a dynamically generated ByteArray, it seems FileReference isn't usable either.
So one idea I had, was just uploading a ByteArray of say 100-200 kB, and calculate the speed of that upload, then fake a progress bar based on that speed, when uploading a larger ByteArray. But then again it would probably be way off under some circumstances, and calculating the current speed would be difficult.
So I need some ideas on how to solve this :)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
最好的方法是查看已经执行此操作的代码。请前往此处查看示例。查看源代码已启用,因此右键单击并查看他们在做什么。
Best way is to look at code that already does this. Go here to see an example. View source is enabled so right-click and look at what they're doing.