使用Firefox的Flex 4 FileReference问题 [英] Flex 4 FileReference Issues With Firefox
问题描述
我正尝试使用运行在Firefox 4中的Flex应用程序中的FileReference执行文件上传。但是,当我尝试调用upload()方法时,Filereference将使用以下元素引发IOError
错误#2038:文件I / O错误。 URL:http:// localhost:8080 / admin / upload
如果我不明确地添加IOErrorEvent的监听器,然后我得到一个Flash播放器弹出窗口,说明:
$ p $安全错误:错误#2000:没有活动的安全上下文。
请求不会打到我的服务器(我可以通过在Java代码中放置断点来验证看着使用HTTPFox的HTTP请求),所以在我看来,这是一个客户端问题(对吧?)。我已经做了一些搜索在谷歌上的问题,并建议包括上传()调用超时/ callLater,并试图附加sessionId的请求(因为Firefox创建一个新的线程上传,而不是附上适当的饼干)。这两种方法都不适用于我。
我不会遇到Internet Explorer的问题,只有Firefox。
有没有人遇到过这个?有什么建议么?感谢您的帮助。
编辑:应该提及SWF和请求的URL在同一台服务器上(localhost:8080)。
对于运行内容Flash Player或在AIR AIR中在应用程序安全沙箱外运行的内容,上载和下载操作只能在其自己的域内以及URL策略文件指定的任何域中访问文件。如果启动上传或下载的内容不是来自与文件服务器相同的域,则在文件服务器上放置策略文件。
<另外 - 这是作为释放或在调试器运行?有时服务器访问的行为是完全不同的。
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
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.
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.
I don't experience this problem with Internet Explorer, only Firefox.
Has anyone encountered this before? Any suggestions? Thanks for any help.
EDIT: Should mention that the SWF and the URL being requested are on the same server (localhost:8080).
From the docs for FileReference:
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屋!