View: test.html
<sc
<form enctype="multipart/form-data" method="POST" >
<input type="file" name="file" id="uploadFile" on
</form>
<sc
function uploadImage() {
$.ajax({
type: "POST",
url: "<?php echo U('index/uploadImage');?>",
data: { file: $("#uploadFile").val() },
enctype: "multipart/form-data",
cache: false,
success: function (msg) {
alert(msg);
},
});
}
</sc
Controller:
public function test()
{
$this->display();
}
public function uploadImage()
{
dump($_FILES['file']);
}
请各位指点一二,感谢!
最佳答案