开发者

Air app, get full path when opening file with FIleReference

开发者 https://www.devze.com 2023-02-12 18:43 出处:网络
I\'m using FileReference to open a file, but I can only get the file name that the user selected, not the full path. Can I get the complete file path, or is there a security issue?Or should I use anot

I'm using FileReference to open a file, but I can only get the file name that the user selected, not the full path. Can I get the complete file path, or is there a security issue? Or should I use another approach?

private function openClicked(e:MouseEvent):void {
    var fr:FileReference = new FileReference();
    fr.browse();
    fr.addEventListener(Event.SELECT , fileSelected);
}

private function fileSelected(e:Event){
    trace ("file sel "开发者_运维知识库 + e.target.name);
        //do stuff

}


The FileReference class does not allow that. You'll need to use the File class instead.

0

精彩评论

暂无评论...
验证码 换一张
取 消