Flex 3 中的 Excel 上传
我正在尝试使用 filereference 上传 excel 文件 但是,上传时会抛出此错误
Error #2044: Unhandled IOErrorEvent:。 text=错误 #2124:加载的文件类型未知。
动作脚本发生错误 继续后,它正在上传文件,但为什么会出现该错误?
谢谢
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
contentLoaderInfo 是关键
contentLoaderInfo is key
查看 http:// www.macromedia.com/support/documentation/en/flashplayer/help/settings_manager04.html 并启用文件所在的目录。如果您从其他域加载它,则需要采取其他预防措施,例如该域上的 crossdomain.xml。
Check out http://scottrockers.com/blog/resources/flash-information/workaround-solution-to-flash-error-2044-unhandled-securityerror-and-error-2048-security-sandbox-violation, but like JAX & Lee said, we need a lot more info. Are you trying to load the excel file from your computer, from a seperate domain, from localhost, from 127.0.0.1? Easiest way is if your trying to load it from a localhost url, that should work. If it's a file on disk, check your security settings http://www.macromedia.com/support/documentation/en/flashplayer/help/settings_manager04.html and enabled the directory where the file resides. If your loading it from some other domain, you need to take other precautions like a crossdomain.xml on that domain.
您是否使用 FileReference 的 .load() 方法?如果是这样,那就不要。只需执行 .browse() 方法,当触发所选事件时,让 FileReference 继续执行 .upload()。您需要使用 .load() 的唯一原因是您的 Flex 客户端需要读取字节。
Are you using the .load() method of FileReference? If so, don't. Just do the .browse() method and when the selected event is triggered, have FileReference go ahead with the .upload(). The only reason you would need to use .load() is if your Flex client needs to read the bytes.