无法在 Flash Player 10 中写入本地文件+在线(但在本地使用时有效)

发布于 2025-01-01 15:47:09 字数 523 浏览 3 评论 0原文

我正在尝试使用 FileReference 类使用 Flash Player 10+ 编写本地文件,遵循 Mike Chambers 的这篇博客文章中的格式: http://www.mikechambers.com/blog/2008/08/20/reading-and-writing-local-files-in-flash-player-10/

本质上代码是这:

private function onSaveButtonClick(event:MouseEvent):void{      
    fr = new FileReference();
    fr.save(fileToSave);}

它在我的机器上本地工作正常,但在线使用时,单击“保存”按钮时不会弹出“保存文件”对话框。我认为这是某种权限或安全相关的问题?

I am trying to write a local file with Flash Player 10+ using the FileReference class, following the format from this blog post by Mike Chambers: http://www.mikechambers.com/blog/2008/08/20/reading-and-writing-local-files-in-flash-player-10/

Essentially the code is this:

private function onSaveButtonClick(event:MouseEvent):void{      
    fr = new FileReference();
    fr.save(fileToSave);}

It works fine locally on my machine but when used online, it doesn't bring up the save file dialogue when the save button is clicked. I assume this is some sort of permissions or security related issue?

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

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

发布评论

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

评论(2

攒眉千度 2025-01-08 15:47:09

您应该检查日志中是否有 SecurityError。当 IO 在本地工作但不能在线工作时,沙箱违规几乎总是原因。

You should check your log for SecurityErrors. A sandbox violation is nearly always the cause when IO works locally but not online.

櫻之舞 2025-01-08 15:47:09

您的FileReference实例可能会被垃圾收集。文件上传也会发生同样的情况。

尝试将其移动到实例变量:

private var fr = new FileReference();
private function onSaveButtonClick(event:MouseEvent):void{      

    fr.save(fileToSave);
}

Your instance of FileReference might be garbage collected. Same happens with file upload.

Try to move it to instance variable:

private var fr = new FileReference();
private function onSaveButtonClick(event:MouseEvent):void{      

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