0 Replies Latest reply on Aug 12, 2011 7:15 AM by htanramA

    browsing a csv file from file system and parsing it.

    htanramA

      Hi,

       

      I am trying to browse a csv file from my file system and using 'fileReference' 'Browse'. URLLoader to load the file and written some parsing logic to parse the file.

       

      var file:FileReference = new FileReference();

       

       

      var csvLoader:URLLoader = new URLLoader();


      private function selectFile():void{

       

           listeners(file);

           file.browse();

       

       

      }


      private function listeners(dispatchers:IEventDispatcher):void{

      dispatchers.addEventListener(Event.SELECT,fileLoadComplete);

      }

       


       

      private function fileLoadComplete(event:Event):void{

           csvLoader.load(new URLRequest(event.currentTarget.name));

           csvLoader.addEventListener(Event.COMPLETE,CSVLoaded);

       

       

      }

       

       

      I am not sure this is the correct way to do this.

       

      But unfortunatly am getting error "#2044: Unhandled ioError:"

       

      Could anyone help me on this.

       

      Thank u in advance.