2 Replies Latest reply on Apr 14, 2010 6:20 AM by levancho

    FileReference.load() crashes FireFox

    haibin_sh Level 1

      Hi,

       

      I'm using FileReference.load() to upload files to server. Usually the file size is about 50M. It _is_ working fine most of the time. But sometimes it crashes FireFox.

       

      I tried to catch the exception, but I did not see any logging when it crashed.

                      try
                      {
                          refUploadFile.load();
                      }
                      catch(error:Error)
                      {
                          if (error is IllegalOperationError)
                          {
                              trace("error is IllegalOperationError");
                          }
                          else if (error is MemoryError)
                          {
                              trace("error is MemoryError");
                          }
                          throw error;
                      }

       

      I'm using Windows XP, FireFox 3.6, Flash Player Debug version 10.0.32.18, Flex Builder 3.0, Flex SDK 3.4

       

      I need to get it fixed. Any idea what I shall do.

       

       

       

      Regards,

      Haibin

        • 1. Re: FileReference.load() crashes FireFox
          haibin_sh Level 1

          I write a very simple swf with the following code and test it with a selection of 32 files (each file is about 60M). It crashes every time.

           

          var fileRefList:FileReferenceList = new FileReferenceList();
          fileRefList.addEventListener(Event.SELECT, selectHandler);
          fileRefList.browse();

          function selectHandler(event:Event):void
          {
              var file:FileReference;
              var files:FileReferenceList = FileReferenceList(event.target);
              var selectedFileArray:Array = files.fileList;
              for (var i:uint = 0; i < selectedFileArray.length; i++)
              {
                  file = FileReference(selectedFileArray[i]);
                  file.addEventListener(Event.COMPLETE, completeHandler);
                  try
                  {
                      file.load();
                  }
                  catch (error:Error)
                  {
                      trace("Unable to upload files.");
                  }
              }
          }
          function completeHandler(event:Event):void
          {
              trace("uploaded");
          }

          • 2. Re: FileReference.load() crashes FireFox
            levancho Level 3

            IMHIO, you are pushing serious  limits there, and FP does not seem to have anough time to GC so it reaches way beyond  the limits of allocated Memory

            32x60 = thats almost 2 GB

             

            have you opened a task manager and monitor firefox proccess while you are doung upload, I bet it skyrockets in memory consuptiona and then dies.