Apache flex 保存/导航到文件问题
单击按钮时,我正在向服务器发送请求:Apache flex 保存/导航到文件问题,apache-flex,flex3,Apache Flex,Flex3,单击按钮时,我正在向服务器发送请求: private function submitButtonClicked():void { var variables:URLVariables = new URLVariables(); variables.table = tableInput.text; var u:URLRequest=new URLRequest("http://sasajkl");
private function submitButtonClicked():void
{
var variables:URLVariables = new URLVariables();
variables.table = tableInput.text;
var u:URLRequest=new URLRequest("http://sasajkl");
u.data = variables;
u.method = URLRequestMethod.POST;
var loader:URLLoader=new URLLoader();
loader.addEventListener(Event.COMPLETE,preparingCompleted);
loader.load(u);
}
来自服务器的响应实际上是一个URL地址,因此我的事件处理程序是:
private function preparingCompleted(event:Event):void
{
var request:URLRequest=new URLRequest(event.target.data);
navigateToURL(request);
}
它过去可以工作,但现在由于,它不再在Chrome中工作了。我试图使用fileReference.download(请求,“Report.xls”)
,但随后我收到一条错误消息,因为该函数不是作为对用户操作(如单击按钮)的响应调用的
有人知道如何从服务器上获取的URL地址访问该文件吗?
谢谢。这是您自己的工作:
ExternalInterface.call("window.open",url);
为什么不呢?你有错误吗?还是什么都没发生?该页面上列出了一些其他解决方案;但我抓到的那个看起来是最简单的。