Flash上​​传进度

发布于 2024-09-26 11:42:56 字数 303 浏览 0 评论 0原文

我正在闪存中进行带宽测试,我想显示进度条和当前计算的速度。对于下载部分来说,这非常简单,但对于上传部分来说,这就有点棘手了。 据我了解,跟踪上传进度的唯一方法是使用 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

无尽的现实 2024-10-03 11:42:56

最好的方法是查看已经执行此操作的代码。请前往此处查看示例。查看源代码已启用,因此右键单击并查看他们在做什么。

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文