Flex FileReference.download - 是否可以打开关联的应用程序
当使用 FileReference.download() 从服务器检索文件时,我想为用户提供直接打开关联应用程序的选项,而不必先将其保存到磁盘。
这在 Flex 3 中可能吗? 如果是这样,它是如何完成的!
谢谢, 马克
附言。 我也尝试过执行 URLLoader.load(URLRequest) ,但没有骰子......
When using FileReference.download() to retrieve a file from a server, I'd like to give the user the option to open the associated application directly rather than having to save it to disk first.
Is this possible in Flex 3? And, if so, how is it done!
Thanks,
Mark
ps. I've tried doing URLLoader.load(URLRequest) also, but no dice...
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
navigateToURL(urlReq, "_blank") 在大多数情况下都有效,但不能在 IE 7 及更早版本中打开 Excel、CSV 文件(MS Office 应用程序)。
navigateToURL(urlReq, "_blank") works in most cases, but do not open Excel, CSV files(MS office apps) in IE 7 and older versions.
不,不幸的是你不能这样做。 我的猜测是这是由于安全限制。
Nope, you can't do that unfortunately. My guess is that this is due to security restrictions.
对于网络应用程序来说,这肯定是不可能的。 可以通过 AIR 应用程序要求操作系统处理文件的打开并保持原样。 Windows 和 OS X 应该能够很好地处理它。
Adobe 限制 Web 应用程序执行此类操作的原因是有道理的。 对于任何人来说,创建一个带有 Flash 应用程序的常规网站都将是一个明显的机会,该网站可以下载并运行病毒,而用户实际上对此一无所知。
From a web application this is most certainly not possible. It might be possible from an AIR application by asking the operating system to handle the opening of the file and leave it at that. Windows and OS X should be able to handle it gracefully.
Why Adobe restricts such actions from web applications makes sense. It would be a glaring oppurtunity for anyone to create a regular site with a flash app that downloads and runs a virus without the user actually knowing anything about it.