Flash 10:如何将数据流式传输到本地文件?

发布于 2024-07-23 10:51:56 字数 235 浏览 3 评论 0原文

我需要 Adob​​e AIR 中的 FileStream 类之类的东西,但需要在 Flash Player 中工作。 我知道有 FileReference#save(),但它只能一次保存整个文件,如果要保存的数据大小大于可用内存,则不起作用...... 是否真的无法将数据流式传输到本地文件以避免将整个数据保留在内存中? 或者也许可以将数据附加到本地文件,而无需先将整个文件读入内存?

我非常需要这个! 谢谢!

I need something like FileStream class in Adobe AIR, but needs to work in Flash Player.
I know there is FileReference#save(), but it can only save the whole file at once, which does not work if the size of the data to be saved is larger than the available memory...
Is it really not possible to stream data to a local file to avoid keeping the whole data in the memory?
Or maybe it is possible to append data to a local file without first reading the whole file into memory?

I need this badly!
Thanks!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

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

发布评论

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

评论(2

樱桃奶球 2024-07-30 10:51:56

你运气不好。 安全限制不允许这种情况在 AIR 应用程序上下文之外发生。

You're out of luck. Security restrictions don't allow this to happen outside the context of an AIR application.

心的憧憬 2024-07-30 10:51:56

如果您有要访问的服务器,您可以通过服务器传递数据来实现。

使用 FileReference.save() 并点击服务器上的某个 URL。 然后,开始将要保存的数据流式传输到服务器,然后让服务器将其重定向到 Flash 客户端。 您需要在服务器上编写一些自定义处理,并且它不会像在本地保存一样快,但这可能是您能够做到这一点的唯一方法。

If you have a server to hit you could sort of do it by passing the data through the server.

Use FileReference.save() and hit some URL on your server. Then, start streaming the data you want saved to the server, and then have the server just redirect that to the flash client. You'll need to write some custom handling of things on the server, and it won't be nearly as fast as just saving locally, but it's probably the only way you'll be able to do it.

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