document.form1.action = ‘postHandler.php’;
document.form1.enctype = ‘multipart/form-data’;
document.form1.target = ‘theHiddenIframe’;
My form code was like this:
<form id=”form1″ name=”form1″>
<input type=”button” value=”upload” onclick=”form_submit()” />
<input type=”file” value=”” name=”uploadfile” />
On Firefox it will work perfectly, but on IE it will send the file as string. What was happening is that on IE you must set the enctype on the form tag because it will not accept the tag to be set dynamically.
Anyway, if you have gone through the same problem this might be one solution.
Update: I got this from a friend of mine. You can set the enctype dinamicly on IE, but you need to use:
document.form1.encoding = ‘multipart/form-data’;