为什么会Ajax上传错误?

这是文件索引:

 <form name="classupload" method="post"  enctype="multipart/form-data" action="">
      <h3>Select pictures:&nbsp;</h3><br />
      <input type="file" name="Filedata[]" style="margin-top:2px;"/><br />
      <input type="file" name="Filedata[]" style="margin-top:2px;"/><br />

      <input type="file" name="Filedata[]" style="margin-top:2px;"/><br />
      <input type="file" name="Filedata[]" style="margin-top:2px;"/><br />
      <input type="file" name="Filedata[]" style="margin-top:2px;"/><br />
       <div id="viac"></div>
         <div style="margin-top:4px;"><a onclick="multiupload();">More</a><br /></div>
        <input type="submit" value="Upload" id="classupload"/>
      </form>

和javascript文件:

jQuery(document).ready(function() { 
$("#classupload").click(function() {
        var xleng=document.classupload.elements['Filedata[]'].length;
        dv = document.createElement("div");
        for (var i = 0; i < xleng ; i++)
        {
            img=document.classupload.elements['Filedata[]'][i].value;
            if(img.toString().length > 1){
                $.ajax({
                    type: "POST",
                    url: "upload.php",
                    data: img,
                    success: function(data_response) {
                        dv.innerHTML = i + ' - ' + data_response;
                    }
                });
            }
        }
        responseStatus("Done!");
        document.getElementById("result").appendChild(dv);

        return false; // avoid to execute the actual submit of the form.


    })

}); 

upload.php文件:

    if ($_REQUEST['Filedata']) {

}

请帮我写个upload.php显示文件,因为没有上传的文件,我什么也得不到,多谢!

You can't upload files via AJAX directly. You need a plug-in that uses a hidden Iframe or makes use of HTML5 features.