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