Flex 保存 URL 文件对话框
我的 Flex Web 应用程序中将有一个 PDF 文档的链接列表。
我想要做的是,单击某个按钮后,打开 URL 列表中某些 pdf 的“另存为”对话框并将其下载到磁盘。
我想避免的是在浏览器中查看 PDF。
我所知道的是 flash.net.FileReference
将获取原始数据但没有链接。那么可能吗?
I will have a list of links to PDF documents in my Flex web app.
What I want to do is that upon clicking some button, open SAVE AS dialog for some pdf from the URL list and download it to disk.
What I want to avoid is viewing PDF in browser.
ALL I know is that flash.net.FileReference
will take raw data but no links. So is it possible ?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
首先,您可以通过 URLStream 的 load 方法从 url 获取原始数据。将其保存为 ByteArray,然后使用 FileReference.save() 方法将文件保存到本地系统(从 Flash Player 10 开始)。
欲了解更多信息,您可以查看:
http://help.adobe.com /en_US/FlashPlatform/reference/actionscript/3/flash/net/FileReference.html#save()
First of all you can use to get raw data from url by URLStream's load method. Save it as ByteArray and later use FileReference.save() method to save files to local system(starting from flash player 10).
For more information you can see at:
http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/net/FileReference.html#save()