使用IE的Ajax进行文件发布

Following is my Ajax call which works fine in all browsers but its messes up only in IE so far. Kindly let me know how can I post file using Ajax and post should support up to IE 6.

var formData = new FormData(document.getElementById('form'));

$.ajax({
    type: "POST",
    url: "email.php",
    data: formData,
    processData: false,  // tell jQuery not to process the data
    contentType: false,   // tell jQuery not to set contentType
    success: function(html){
        if (html.indexOf("filerror") != -1)
        {
            alert('error');
        }
        else if(html.indexOf("true") != -1)
        {
            alert('true');
        }
        else if (html.indexOf("false") != -1)
        {
            alert('false');
        }
    },
    beforeSend:function()
    {

    }
});

IE6 doesn't support HTML5's FormData object which allows for uploading files using AJAX. Sorry but you will have to resort to far more stone age techniques to achieve that such as hidden iframes or flash movies. You might also consider using plugins such as Uploadify or the jQuery form plugin which will detect the capabilities of the client browser and depending on them will use the best possible technique. This way you don't need to be dealing with and maintaining code for some dead and buried under the ground browsers such as IE6.

For IE6 you should use trick with sending form to the iframe and then check if the iframe is loaded. It's the best and the easiest thing you can do here.