html大概的结构:
<form id="uploadForm" action="uploadImg.ashx" method="post" enctype="multipart/form-data">
<input id="fileImage" type="file" size="30" name="fileselect[]" multiple /> <button type="button" id="fileSubmit" class="upload_submit_btn">确认上传图片</button>
Ajax:
for (var i = 0, file; file = this.fileFilter[i]; i++) {
(function(file) {
var formData = new FormData();
formData.append(file.name,file);
$.ajax({
url: self.url,
type: 'post',
data: formData,
contentType: false,
processData: false,
success: function(data) {
self.onSuccess(data);
self.funDeleteFile(file);
},
error: function(data) {
console.log("error");
self.onFailure(file);
}
})
if(!self.fileFilter.length){
//执行完成
self.onComplete();
}
})(file);
}
}
请问我的ashx里面怎么写才可以存入到本地呢?另外也得从本地读取图片然后用ajax传回给html,请问有没有例子示范下,谢谢