flex客户端 下载

下载很简单不需要使用后台文件代码如下

private   var downloadURL:URLRequest;
 private    var DownLoadfile:FileReference;
private function downLoadFiles(urlAdd:String):void
    {
        downloadURL = new URLRequest("http://localhost:8080/upLoaderfile/upload/"+urlAdd);
        DownLoadfile = new FileReference();
        configureListeners(DownLoadfile);
        DownLoadfile.download(downloadURL);
    }
     private function configureListeners(dispatcher:IEventDispatcher):void {
        dispatcher.addEventListener(Event.COMPLETE, completeHandler);

    }
   
    private function completeHandler(event:Event):void {
    mx.controls.Alert.show("文件下载成功");
    }
urlAdd就是你要下载的文件的名称

你可能感兴趣的:(Flex)