Firefox 的 Flex 4 FileReference 问题 [英] Flex 4 FileReference Issues With Firefox

查看:22
本文介绍了Firefox 的 Flex 4 FileReference 问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用 Firefox 4 中运行的 Flex 应用程序中的 FileReference 执行文件上传.但是,当我尝试调用 upload() 方法时,Filereference 会抛出一个 IOError 并包含以下内容

I'm trying to perform a file upload using a FileReference from a Flex app running in Firefox 4. However when I attempt to call the upload() method, the Filereference throws an IOError with the following

Error #2038: File I/O Error. URL: http://localhost:8080/admin/upload

如果我没有为 IOErrorEvent 明确添加侦听器,那么我会看到一个 Flash 播放器弹出窗口说明

If I don't explicitly add a listener for the IOErrorEvent, then I get a Flash player popup stating

SecurityError: Error #2000: No active security context.

请求甚至没有到达我的服务器(我可以通过在 Java 代码中放置断点并观察使用 HTTPFox 发出的 HTTP 请求来验证),所以在我看来这是一个客户端问题(对吗?).我已经在 google 上搜索了一些问题,建议包括将 upload() 调用包装在 timeout/callLater 中,并尝试将 sessionId 附加到请求中(因为 Firefox 为上传创建了一个新线程并且没有附上适当的饼干).这两种方法都不适合我.

The request doens't even hit my server (I can verify by placing breakpoints in the Java code and watching the HTTP Requests that go out using HTTPFox), so it seems to me that this is a client side issue (right?). I've done some searching for the problem on google and the suggestions included wrapping the upload() call in a timeout/callLater, and attempting to attach the sessionId to the request (since Firefox creates a new thread for the upload and doesn't attach the proper cookies). Neither of these approaches has worked for me.

我在 Internet Explorer 上没有遇到这个问题,只有 Firefox.

I don't experience this problem with Internet Explorer, only Firefox.

有没有人遇到过这种情况?有什么建议?感谢您的帮助.

Has anyone encountered this before? Any suggestions? Thanks for any help.

应该提到 SWF 和所请求的 URL 位于同一服务器 (localhost:8080) 上.

Should mention that the SWF and the URL being requested are on the same server (localhost:8080).

推荐答案

来自 文件参考:

对于在 Flash Player 中运行的内容或在应用程序安全沙箱之外的 Adob​​e AIR 中运行的内容,上传和下载操作只能访问其自身域内以及 URL 策略文件指定的任何域内的文件.如果发起上传或下载的内容与文件服务器来自不同的域,请将策略文件放在文件服务器上.

For content running in Flash Player or for content running in Adobe AIR outside of the application security sandbox, uploading and downloading operations can access files only within its own domain and within any domains that a URL policy file specifies. Put a policy file on the file server if the content initiating the upload or download doesn't come from the same domain as the file server.

此外 - 这是作为发行版运行还是在调试器中运行?有时服务器访问的行为完全不同.

Also - is this running as release or in the debugger? Sometimes the behavior for server access is quite different.

这篇关于Firefox 的 Flex 4 FileReference 问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆