我正在使用mootools创建ajax上传程序。当我删除ajax并简单地上传表单时,我得到$ _FILES和存在的文件数据。但是当我使用ajax版本时,$ _FILES超级全局变量是空的。表格的其他部分都存在。它的行为就好像它根本不发送图像,但只在ajax版本中发送。任何帮助表示赞赏。 谢谢!使用Mootools上传图片
<form id="uploadphoto_pod" action="upload.php" enctype="multipart/form-data" method="post">
<input type='file' id='uploadphoto' name='uploadphoto'/>
<input type="submit" class="submit" name="add_product" value="Upload" />
</form>
<div id="response"><!-- Ajax Response --></div>
<script type="text/javascript">
window.addEvent('domready', function(){
$('uploadphoto').addEvent('submit', function(e) {
//Prevents the default submit event from loading a new page.
e.stop();
//("this" refers to the $('uploadphoto') element).
this.set('send', {onComplete: function(response) {
$('response').set('html', response);
}});
//Send the form.
this.send();
});
});
</script>
谢谢您的回应 – abhis 2010-11-27 10:44:58