5 Replies Latest reply on May 27, 2010 9:20 PM by focus_vikas

    FileReference.download() problem

    focus_vikas

      Hi,

       

      I am trying to download a file from server.

       

      below is my code.

       

      var fileName:String="Test.mxml";

       

       

      var url:String = "https://test.abc.com/opguide/"+fileName;

       

       

       

       

      var fileRefDownload:FileReference = new FileReference();

       

       

      var urlRequest:URLRequest = new URLRequest(url);

      fileRefDownload.addEventListener(Event.COMPLETE, onComplete);

      fileRefDownload.addEventListener(IOErrorEvent.IO_ERROR, onIOError);

      fileRefDownload.download(urlRequest);

       

       

      var succeed:Function = function(){};

       

      I am not doing anything in onComplete and onIOError methods. https://test.abc.com/opguide/Test.mxml exists at this path.

      But when i click on download link from where I am calling the above code, the pop up window does not come. using popup window i will decide where I am going to save this file on local system.

      I am using below softwares

      flash player Test.mxml

      creates war using Jdeveloper 10.1.3.3

      flex builder 3

      Firfox 3.6.3

       

      I just uninstalled the flash player, and install the new flash player. After that the above problem is coming. Before this it was working fine.

       

       

      Above is our test server. On production server same code is giving the below error mesage:

       

      Error: Error #2176: Certain actions, such as those that display a pop-up window, may only be invoked upon user interaction, for example by a mouse click or button press.
      at flash.net::FileReference/download()

       

       

      Please give me some solution.

       

      Thanks in advance.

       

      --

      Vikas Jain