Home > ColdFusion, Flex 3 > Error #2044: Unhandled IOErrorEvent:. text=Error #2038: File I/O Error.

Error #2044: Unhandled IOErrorEvent:. text=Error #2038: File I/O Error.

I have been getting the error ‘Error #2044: Unhandled IOErrorEvent:. text=Error #2038: File I/O Error.‘ when uploading my images for a while without any luck of what was causing my issues. Then after building a new module for a flex project I am currently working on, I finally made a breakthrough.

Scenario
2 tables in MySQL.

  1. Table One: contains information about a classified
  2. Table Two: contains names of images that are related to each classified.

hint:You can have a single classified with multiple images

I built a Flex Module with 2 popup forms.
One for the classified information and the other has an image uploader.  each image is uploaded, resized and renamed.

My problem was two issues.

I needed to apply a hotfix to my server – http://kb2.adobe.com/cps/403/kb403411.html
I don’t know if this helped me, but it sure didn’t hurt me.

Second, was timing….

Symptoms

  1. upload some images but not others
  2. upload the same image one time but not in another.

I could upload small images (size in kb), but nothing above a certain range. I could upload the same image sometimes when it came to about a 500-600kb size.

At first I thought of these items that could hurt my upload; Size, Format, and Naming Convention.

I was following my image that I was uploading and noticed it was showing up for a few seconds in the upload directory and then it would disappear. WTF? I finally figured out what was happening.

When uploading my file, here is what was happening step by step

  1. user selects image to upload
  2. user clicks save button
  3. The record is saved with new name ClassID-ImageID.extension through cfc save. After I create my record in my create cffunction, I do an updated on the record I just created with the new number. ( this is because the record in the Image table is autonumber and I simply cannot get the new ID safely).  This comes back to the ResultEvent in the Remote Object.
  4. I then get my information that I need to change my file name and upload my file.
  5. the form closes and the image should show up in an area I have created.

Here is the issue with the above. my upload was not completed most of the time when my form was closing. hence the image showing up and then disappearing.

Solution

I already use a mx.loader for previewing my image. I added this to my processing event whenuploaded and removed the close function I was calling. I also disabled the save button for the upload. The reason i didn’t think about this was becuase the result event where my close function resides is after the imageupload function. (errrgg!)

Now I see my image being uploaded to the server, from the form and I have tracked it viewing the directory and watch it show up. My only issue now is I need some sort of mechanism that tells me the file has been uploaded, renamed and resized is finished. I suspect I will be uploading the image to a processing directory, renaming and resize it there and then do a move to another directory when finished. Then I can create a timer mechanism that calls a CFC every second that will check if the file is there. It if is then it will return a boolean of true. and that will close my form.

Reason of Error: interruption of upload

ColdFusion, Flex 3 , , , ,

  1. No comments yet.
  1. No trackbacks yet.
You must be logged in to post a comment.