在Flash中读取本地文件 [英] Read local file in Flash

查看:137
本文介绍了在Flash中读取本地文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以在Flash中读取本地文件?我的应用程序使用 flash.net.FileReference 类,我想在我上传它们之前偷看。有两种迹象表明,为什么它可能是:


  • 我将会看到文件的内容服务器无论如何。

  • Silverlight可以做到这一点。 System .IO.FileInfo 类提供了一个流。




但到目前为止,一切都表明,否则。文档中似乎没有任何内容,Google搜索没有显示任何有用的信息。我只是想确定在我继续前进之前是不可能的。 Flash Player 10支持通过一个方法和一个属性 - FileReference .load()和FileReference.data。一旦用户用FileReference.browse()选择了他们想要的文件,你就可以调用load(),监听Event.COMPLETE事件,然后引用data属性来提取你想要的数据。 b $ b

Is it possible to read a local file in a Flash? My application uploads files to server using the flash.net.FileReference class, and I would like to peek inside before I upload them. There are two indications as to why it could be possible:

  • I'm going to see the content of the files on the server anyway.

  • Silverlight can do that. The System.IO.FileInfo class provides a stream.

But so far, everything indicates otherwise. There seems to be nothing in the documentation, and a Google search has not revealed anything useful. I just want to make sure that it's not really possible before I move on. I'm aware that one can do it in AIR.

解决方案

Flash Player 10 supports this via a method and a property - FileReference.load() and FileReference.data. Once the user has selected the file they want with FileReference.browse() you can then call load(), listen for the Event.COMPLETE event, and then reference the data property to pull out the data you want.

这篇关于在Flash中读取本地文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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