如何更改 Flash 播放器设置以允许浏览器列出本地文件夹中的文件?

发布于 2024-11-29 08:25:18 字数 80 浏览 3 评论 0原文

我需要列出网络浏览器(flex 应用程序)上本地文件夹下的文件。 如何更改 Flash 播放器的属性,以便浏览器列出文件? 如有帮助,将不胜感激。

I need to list the files under a local folder on web browser(flex app).
How do i change the properties of flash player so that it will browser list the files?
Help would be appreciated.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

呢古 2024-12-06 08:25:18

您可以使用文件引用。
但是,在网络浏览器中,如果存在用户交互(IE:单击鼠标),您将被锁定只能使用此功能。
超过此范围将构成重大安全风险,Flash 播放器将不允许这样做。
对此我们无能为力。

话虽如此,如果您不需要浏览器,您可以通过 Air 应用程序访问它,而不必处理安全问题。

You can use FileReference.
However, in a web browser you are locked into only using this function if there is user interaction( IE:a mouse click ).
Anything over then this would be a major security risk and Flash player will not allow it.
There is nothing that can be done about this.

With that being said if you can do without a browser you can access it through an Air app without having to deal with the security issues.

迷路的信 2024-12-06 08:25:18

浏览器中的Flash播放器无法浏览服务器上的文件。您将需要使用服务器端脚本(例如 PHP)来提供此数据。

Flash Player 中的文件浏览器仅浏览用户本地硬盘驱动器。

The flash player in a browser does not have the ability to browse the files on a server. You will need to use server-side scripting, such as PHP, to make this data avaiable.

The file browser in flash player just browses the users local hard drive.

秋叶绚丽 2024-12-06 08:25:18

这是我的代码:

// ActionScript file

   import flash.display.*;
   import flash.events.*;
   import flash.net.FileFilter;
   import flash.net.FileReference;
   import flash.net.FileReferenceList;
   import flash.utils.ByteArray;    
   import mx.collections.ArrayCollection;
   import mx.controls.Alert;

    private var fr:FileReferenceList;
    [Bindable] private var zfls:Array;
    [Bindable] private var zfile:FileReference;
    [Bindable] private var zipfl:ArrayCollection;

    private function folder():void
    {
        fr = new FileReferenceList();
        fr.browse([new FileFilter("Zip Files", "*.zip")]);
        fr.addEventListener(Event.SELECT, listZipFiles);            
    }

    private function listZipFiles(event:Event):void
    {
        Alert.show("selectHandler: " + fr.fileList.length + " files");          
        zfile = new FileReference();
        zfls = new Array();  

        for (var i:uint = 0; i < fr.fileList.length; i++) 
        {
            zfile = FileReference(fr.fileList[i]);
            //Alert.show("Length of zfile is " + zfile.size);
            zfls.push(zfile);                                                   
        }
        //Alert.show("Is the File comming in?" + zfls);
        zipfl = new ArrayCollection(zfls);
        //Alert.show("Length of zipfl is" +zipfl);          
    }

然后我将 zipfl 绑定到组合框。

Here is my code:

// ActionScript file

   import flash.display.*;
   import flash.events.*;
   import flash.net.FileFilter;
   import flash.net.FileReference;
   import flash.net.FileReferenceList;
   import flash.utils.ByteArray;    
   import mx.collections.ArrayCollection;
   import mx.controls.Alert;

    private var fr:FileReferenceList;
    [Bindable] private var zfls:Array;
    [Bindable] private var zfile:FileReference;
    [Bindable] private var zipfl:ArrayCollection;

    private function folder():void
    {
        fr = new FileReferenceList();
        fr.browse([new FileFilter("Zip Files", "*.zip")]);
        fr.addEventListener(Event.SELECT, listZipFiles);            
    }

    private function listZipFiles(event:Event):void
    {
        Alert.show("selectHandler: " + fr.fileList.length + " files");          
        zfile = new FileReference();
        zfls = new Array();  

        for (var i:uint = 0; i < fr.fileList.length; i++) 
        {
            zfile = FileReference(fr.fileList[i]);
            //Alert.show("Length of zfile is " + zfile.size);
            zfls.push(zfile);                                                   
        }
        //Alert.show("Is the File comming in?" + zfls);
        zipfl = new ArrayCollection(zfls);
        //Alert.show("Length of zipfl is" +zipfl);          
    }

and then i m binding zipfl to a comboBox.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文