Error #2044: Unhandled IOErrorEvent:. text=Error #2038: File I/O Error.
This error can be caused for a variety of reasons. In most cases the server is rejecting the request. When Flash get the response from the server.
– incorrect path to the upload file script – check relative and absolute paths
– a incorrect location for the files to be stored on the server specified inside server-side upload script – check path is correct and permissions are correct
– file is too large so server rejects it – check max file size
– there is no space on the server to save the file – check server hard drive space
– your actionscript handler is going out of scope because it’s declared locally,
etc – create a strong event listener or declare the file reference on the class
It is closely related to this error.
// incorrect url (no file named upload1.php) request = new URLRequest("http://www.somesite.com/upload1.php") // correct url request = new URLRequest("http://www.somesite.com/file_upload.php") try { // upload file fileRef.upload(request); textarea1.text = "uploading " + fileRef.name + "..."; } catch (error:Error) { trace("Unable to upload file."); }
More answers are in the comments…
Please reply in the comments below if this helped you or not. You can also use the Error Lookup to look up Flex compiler or runtime errors.
I’d like to refine the description of this error code.
This error occurs everytime when you specify wrong path to the server-side upload script, not to a file itself.
LikeLike
does it mean relative path will not work for this? I have tried locally and it works but not when I have uploaded to server.
LikeLike
[…] the Adobe LiveDocs runtime error listings are not particularly helpful in this regard. Judah’s blog post on the matter does give some additional info, but neither David or I had encountered this error because of a […]
LikeLike
I have a really strange error like this, hopefully you guys have a pointer to why.
I have a upload flex page that works great with any osx machine that I use (safari and firefox) but throws a 2038 error when using any windows machine (opera and IE)..
Has anyone seen such an error? and if so, any ideas on the fix would be really apprecialted.
Thanks
Blake
LikeLike
I want to add the clarification for the possible reason of Error #2044: Unhandled IOErrorEvent:. text=Error #2038: File I/O Error.
Even if the server-side upload script is located at the server at the correct location, this Error#2038 can still happen inside Flash player.
The reason for this can be a WRONG location for the files to be stored on the server specified inside server-side upload script.
Inside IE and Firefox the behavior under Flash player during file uploads differs, it definitely worth an effort to test file upload independently under all target browsers
LikeLike
I would like to add an information about the IO Errors that it can be caused by ModSecurity module in Apache and throws back a 406 http not acceptable error. to get it solved you can add .htaccess file to the script directory and to the destination folder for the file transfer that includes the following:
SecFilterEngine Off
SecFilterScanPOST Off
this will disable the ModSecurity module for that folder.
LikeLike
If testing locally and you’re getting these errors, be sure that your firewall is not blocking FLEX or FLASH.
LikeLike
My problem when I was trying multiple, queued uploads, was that the FileReference was going out of scope. I used a strong reference instead of a weak one while listening for the IOError event, and could then handle it.
I put some of the other things I tried at http://dev.nuclearrooster.com/2008/04/05/uploading-with-a-filereference-from-flex-3-on-os-x/
LikeLike
Taher Mestiri, man you saved my life with this :
SecFilterEngine Off
SecFilterScanPOST Off
Thanx! Thanx! Thanx! Thanx! Thanx! Thanx! Thanx! Thanx! Thanx!
LikeLike
Likewise, Taher Mestiri, you have saved me as well. I’ve been pulling out my hair trying to figure out why everything works fine on my local server, then falls apart with 2044 and 2038 errors on my web server.
Thanks a bunch.
LikeLike
I’m sorry… I don’t know what this mean.
Anybody could told me how to do this?
I can’t creat a file names .htaccess in windows vista~~
Thanks ~~
I would like to add an information about the IO Errors that it can be caused by ModSecurity module in Apache and throws back a 406 http not acceptable error. to get it solved you can add .htaccess file to the script directory and to the destination folder for the file transfer that includes the following:
SecFilterEngine Off
SecFilterScanPOST Off
LikeLike
Is there an equivalent for the ModSecurity error on ASP servers? I’m using Flash to send the file & some additional POST variables to an ASP script on the server. The ASP script functions fine when we submit to it using an HTML form, but if I use Flash, I get the “Error #2038: File I/O Error”.
Also thinking about JabbyPanda’s wrong file location in the server script, is it possible that the script would work fine with an HTML form but not with a Flash one?
Thanks!
–eric
LikeLike
Also, just to add an additional bit of fun to the mix, the upload works fine on PC running Internet Explorer and/or FireFox, but throws the IO error on Mac running FireFox and/or Safari.
Any ideas anyone?
LikeLike
Legend, thanks!
LikeLike
My problem was the size off the file.
Test with a smaller file and see if it works.
My asp.net installation accepted 3.1MB.
LikeLike
Nick that did the trick! I was using a weak event listener reference for my FileRef object. Strong refs = no more errors.
LikeLike
Since this error has been arond for quit a while is there indication when Adobe will get to fixing this seemingly easily to fix but a very difficult to debug problem?
LikeLike
I tried having an htaccess file with the directives as given but it is still not working. Rather the entire folder is giving a 500 error. Apache logs contain the following entry
Invalid command ‘SecFilterEngine’, perhaps misspelled or defined by a module not included in the server configuration
Can anyone help me here?
–Fahad
LikeLike
I am talking about Flex & Java as backend using Tomcat server.
1. If you have size issues make sure you create “temp” directory under tomcat/temp
2. If you should use apache commons-fileupload which is piece of cake to use
// Create a factory for disk-based file items
FileItemFactory factory = new DiskFileItemFactory();
// Create a new file upload handler
ServletFileUpload upload = new ServletFileUpload(factory);
// Parse the request
List items = upload.parseRequest(request);
// Process the uploaded items
Iterator iter = items.iterator();
while (iter.hasNext()) {
FileItem item = (FileItem) iter.next();
if (item.isFormField()) {
// parse normal field values
} else {
File uploadedFile = new File(realPath+fileName);
item.write(uploadedFile);
}
}
Above code is for servlet (just add post or get method definition to get going.
Also make sure you use correct url e.g. http://localhost:8080/blazeds/Upload, where “Upload” is mapped in web.xml as following
CaseFileUpload
com.bugger.server.CaseFileUpload
CaseFileUpload
/Upload
Hope it will help someone.
LikeLike
I also have had the Error #2044: Unhandled IOErrorEvent:. text=Error #2038: File I/O Error. The problem for me was that some of the file names had apostrophes in them such as when I went to upload a song like
The Who – Baba O’Reilly.mp3
When I removed the apostrophe then no error. Hope this might help some out.
Jim
LikeLike
I ran into this error too, and solved it by realizing i had defined a proxy server for IE7 the day before. Once i disabled the proxy usage, magical, it worked. Pain.
LikeLike
I am using Rails to process uploaded images and was getting this error when testing on IE/WIndows. I fixed it by using an XML response instead of text/html.
LikeLike
Guys! what i found is flash/flex takes session settings of IE and does not read the session of firefox, that is why people using firefox got error# 2038. Try following steps and you will probably get the scenario
1. Login using IE browser.
2. Now login thorugh firefox (Do not close IE session)
3. upload file. it will work fine.
4. Logout from IE only.
5. upload file through firefox. Error will appear.
I tried it many times with different combinations and every time got the same result.
If this is the real problem then may be some guy can give a solution.
LikeLike
Zahid – thanks for this. I’ve been pulling my hair out trying to work out why the upload from a flex app on firefox failed with the I/O Error, yet the same upload from a html form worked fine. Opened IE, altered proxy settings to add *.local to exceptions, retried, and it worked fine. Bit of a PITA if you use firefox as your browser and hardly use IE. Moral of the story is make sure your IE is set up properly even if you never use it…
There may be more to this – maybe someone who knows how the flash player interacts with the browser/system/environment may be able to provide more details on what settings are used and how to change them?
LikeLike
Adobe/Macromedia = crap.
I can’t seem to resolve this bug.
It’s happening both with php and java.
How come it return an error like that w/o telling the cause.
LikeLike
is it working for flex web application?
LikeLike
Taher Mestiri says:
February 19, 2008 at 10:09 am
I would like to add an information about the IO Errors that it can be caused by ModSecurity module in Apache and throws back a 406 http not acceptable error. to get it solved you can add .htaccess file to the script directory and to the destination folder for the file transfer that includes the following:
SecFilterEngine Off
SecFilterScanPOST Off
this will disable the ModSecurity module for that folder.
Thanks Taher Mestiri . it is solved the error , now upload working fine.
LikeLike
My experience about this error is with swfupload,
testing on any server local or production. (mampp local, dreamhost on production)
No matters the plugin version.
I was testing the website in firefoxeverything was working fine but upload.
tried with safari.
safar unable to connect..
unchecked prosy settings in safari.
back to firefox
upload succesful.
no more error #2035
LikeLike
On nginx was getting this error for files greater then 1mb. Fixed using the client_max_body_size directive.
LikeLike
Pam,
I still face this error when i send csv data to a servlet through the request which read from request and sends it to response stream.
I am facing below error when the data is greater than 1MB.
ERROR:#2038 File I/o Error. URL
LikeLike
Pam,
I still face this error when i send csv data to a servlet through the request which read from request and sends it to response stream.
I am facing below error when the data is greater than 1MB.
ERROR:#2038 File I/o Error. URL
Can you explain me how exactly you fixed this problem.
LikeLike
This is why Actionscript is sh*t, full of bugs and errors which have completely vague and generic error codes which making it incredibly awkward and tedious to resolve any issues. This is why I’m dumping flash for good. Adobe I can’t wait till you disappear off the face of the planet!!!
LikeLike
Zahid Riaz , you are right , i got the same result so how to solve ?
1. Login using IE browser.
2. Now login thorugh firefox (Do not close IE session)
3. upload file. it will work fine.
4. Logout from IE only.
5. upload file through firefox. Error will appear.
by the way i added .htaccess
SecFilterEngine Off
SecFilterScanPOST Off
in uploaddir and it works with uploading any size without getting
i/o error but failed with downloading the file .
LikeLike
This error (#2038) seems to be very random (various platforms, various OS etc etc). I can one day get the error while uploading a file while it goes without errors the other. This error seems to have been in flash for ages without Adobe doing anything to fix it. I’m following Cathal and leaving Flash behind, just as S. Jobs have done with Apple.
LikeLike
I was referred to your blog by Flex harUI in the Adobe forum for this issue. Unfortunately, this is the same result as the rest of the web. I’ve almost reached the end of the internet hunting this, and I’ve definitely reached the end of my wits.
1. in Air, FileReferenceList doesn’t objects in fileReferenceList do not fire the complete event when doing fileList[i].load(). In a Flex project it works fine. Flex SDK 4.1.
Result: rewrite this part o the Air app in Flex, hosted in an HTML component.
2. FileReferenceList randomly gets #2038 from upload() process. I’ve ensured proper variable scope in client and web.config server settings; .Net 3.5 using either an httpHandler or a standard .aspx processing page.
Result: load fileReferenceList.fileList into an arrayCollection along with a status variable to retry files that the get 2038’s.
Would be glad to post code, but if it doesn’t really resolve the issue, I feel I’d just be leading others down another rabbit hole.
LikeLike
Greg, I think you’ll find the answers in the comments. It could be caused for a variety of reasons. It comes down to the server either rejecting the file upload for some reason and any condition that causes Flash to not get the response from the server.
– The reason for this can be a WRONG location for the files to be stored on the server specified inside server-side upload script.
– Wrong location to the upload file script
– File is too large so server rejects it
– there is no space on the server to save the file
– your actionscript handler is going out of scope because it’s declared locally,
etc
LikeLike
I used FireFox Browser and got flex error saying “Error #2044: Unhandled IOErrorEvent:. text=Error #2038: File I/O Error.” when uploading a file using FileReference.upload(). I captured tcpdump and found that it was due to ISA HTTP proxy returning error “HTTP/1.1 407 Proxy Authentication Required ( The ISA Server requires authorization to fulfill the request. Access to the Web Proxy filter is denied. )”.
Eventhough FireFox is configured with ISA proxy username and password this error was seen. Which means flex FileReference object doesn’t use the proxy username and password setting configured in firefox.
I tried the same upload with same proxy settings from IE and it worked fine.
LikeLike
One difference is observed between the way HttpService and FileReference when HTTP requests is sent with HTTP proxy is configured.
Flex HttpService : First HTTP request is made without proxy auth headers. When it fails with “HTTP/1.1 407 Proxy Authentication Required” second request is sent with Proxy-Authorization: Negotiate header and this succeeds.
Flex FileReference : One HTTP request is made without proxy auth headers. When it fails with “HTTP/1.1 407 Proxy Authentication Required” second request is not sent with Proxy-Authorization: Negotiate header.
LikeLike
I get 2044 error when trying to display a local html file using StageWebView in a Flex Mobile project.
LikeLike
Sunil – you can use the code below to find the correct path to the local HTML file:
LikeLike
IO error in Firefox bcoz flash/flex takes session settings of IE and does not read the session of firefox. So you need to some piece of code just below in web.config of your ASP.Net project:
LikeLike
LikeLike
Thanks Avipriya
LikeLike
[…] http://www.judahfrangipane.com/blog/2007/01/01/error-2044-unhandled-io errorevent-texterror-2038-fil… […]
LikeLike
Hello,
I have a strange error like this on a problem , the upload works fines on windows (firefox, ie, chrome, safari) but fails on safari mac (but only on somes macs , very strange)
I dunno what to do.. the path of the upload script is ok and I dont have mod security enabled (server is linux debian with Apache/2.2.16)
Any suggestions? It happens even with small filesize (< upload_max_size)
LikeLike
For some strange reason, upload is failing for HTTPS protocol on Firefox (if you have any problems with your certs like SSO cert). If you use HTTP it’s ok.
LikeLike