4 Replies Latest reply: Nov 21, 2013 2:46 AM by gbarry74 RSS

    Flex upload #2038 I/O Error

    luke3design!! Community Member

      Hi to all!!!!!

       

      I coded an actionscript procedure which takes a list of files to upload and it begins to upload them one at a time.

      The first file in the list is uploaded correctly (the file is loaded in the correct directory, I obtain the response from the server and also I write successfully file information into a mysql table ), but after a while a #2038 I/O error is fired.

      I can't really understand what's going wrong since all the previous task are performed correctly.

       

      The filereference variable is declared outside of any function so I don't miss the reference whene the functions' scope is cleared out.

       

      Below the function code:

       

      the fileUpload variable is declared outside the function. I just reinitialize it.

      _uploadQueue is an array containing all the filereference objects which have to be loaded.

      the index param is always zero because I always upload the first item in the list (...that's just for keep it ready for future changement)

       

      private function uploadFileIndex(index:int):void{
                          trace("uploadFileIndex-> ",index,this._uploadQueue.length)
                          this.fileUpload=new FileReference()
                          this.fileUpload=this._uploadQueue[index]                            
                          this.fileUpload.addEventListener(ProgressEvent.PROGRESS,this.progressUpload)
                          this.fileUpload.addEventListener(DataEvent.UPLOAD_COMPLETE_DATA,this.responseUpload)
                          this.fileUpload.addEventListener(Event.COMPLETE,this.finishUpload)            
                          this.fileUpload.addEventListener(IOErrorEvent.IO_ERROR,this.handleError)    
                          this.fileUpload.upload(this.uploadService)    
                          trace("uploadFileIndex-> load")
                          if(grdUpload.alpha==0){
                              this.fadeIn.play() //just an effect to display the queue
                              }    
                          }
      

       

       

      below the output:

       

      uploadFileIndex-> load
      Upload-> response:  File loaded
      Upload error->  [IOErrorEvent type="ioError" bubbles=false cancelable=false eventPhase=2 text="Error #2038: Errore di I/O del file. URL: http://www.domain.com/php/fxUploadEcm.php?folder=ecm&idDirectory=3&overwrite=0&sId=---session_id---"] (flash.events::IOErrorEvent)#0
        bubbles = false
        cancelable = false
        currentTarget = (flash.net::FileReference)#1
          creationDate = Wed Feb 16 12:32:17 GMT+0100 2011
          creator = (null)
          data = (null)
          modificationDate = Wed Feb 16 12:33:33 GMT+0100 2011
          name = "usa_3.jpg"
          size = 921849
          type = (null)
        errorID = 0
        eventPhase = 2
        target = (flash.net::FileReference)#1
        text = "Error #2038: Errore di I/O del file. URL: http://www.domain.com/php/fxUploadEcm.php?folder=ecm&idDirectory=3&overwrite=0&sId=---session_id---"
        type = "ioError"
      
      

       

      the upload starts correctly, it traces the progress event correctly (which  also correctly updates a progress bar ).

      The upload process ends correctly (I can trace the response of the php script).

      After this.....kaboom!!!!

      The #2038 error is fired.... :-(

       

      Even more strange is that sometimes it uploads the first file and also the second, but then it crashes on the third file.....

       

      Has somebody faced the same issue?

       

      Thanks in advance.

      best regards!!!!

       

      P.S.

      I'm on flash builder 4 on mac firefox

        • 1. Re: Flex upload #2038 I/O Error
          wormie76 Community Member

          I'm having the same problem, came here to check, but I decided to give it a try reading some more when I found this from documentation about FileReference, not sure if it's the same problem... Im running FB4 , FP10.1, on IE7 :

           

          [...]
          Note that because of new functionality added to the Flash Player, when publishing to Flash Player 10, you can have only one of the following operations active at one time: FileReference.browse(), FileReference.upload(), FileReference.download(), FileReference.load(), FileReference.save(). Otherwise, Flash Player throws a runtime error (code 2174). Use FileReference.cancel() to stop an operation in progress. This restriction applies only to Flash Player 10. Previous versions of Flash Player are unaffected by this restriction on simultaneous multiple operations.

          While calls to the FileReference.browse(), FileReferenceList.browse(), or FileReference.download() methods are executing, SWF file playback pauses in stand-alone and external versions of Flash Player and in AIR for Linux and Mac OS X 10.1 and earlier [...]

           

          Hmmm wondering which "new functionality added" is causing this lol

           

          OK, running to check if I can make it work again, I'll let you know.

          • 2. Re: Flex upload #2038 I/O Error
            luke3design!! Community Member

            It's interesting!!!!

             

            My issue was that when the first file was uploaded I tried to upload the second one (listening for the COMPLETE event), but this raised the #2038 error.

            The feeling I have is that when the COMPLETE event is dispatched, the upload process is not really 100% completed and so it raise this error according to the documention you reported (two upload at the same time)

             

            The workaround I found is to place a timer (300-400ms) at the end of each upload so I'm 100% sure that the previous upload process is completed.

            Maybe it's not the best solution but it works smoothly.

             

            Anyway if you found some other ways to fix thi issue, pleas share it!!!!

            Regards!!!

            • 3. Re: Flex upload #2038 I/O Error
              samschauhan Community Member

              Hi,

               

              I also got into this issue some 4 months back.

              Raised an issue against Adobe:

               

              http://bugs.adobe.com/jira/browse/FP-6206

               

              While browsing thru Adobe Bugs I found atleast 2 such issues raised years ago which are waiting for a solution till today.

               

              Regards,.

              Sam

              • 4. Re: Flex upload #2038 I/O Error
                gbarry74 Community Member

                Hi,

                I got stuck on this kind of issue : all upload working fine except using IE and https.

                In fact the issue was strangly on server side, I was using commons-fileupload from apache to handle my upload java side in version 1.2. Switching to 1.3 as fix my issue. It has a bug reading the file size.

                Regards