在我的网站中,我想使用 ajax 上传一个压缩文件夹。
代码:
<script type="text/javascript">
$(function(){
var btnUpload=$('#file_mod');
new AjaxUpload(btnUpload, {
action: "index.php",
name: 'file',
onSubmit: function(file, ext){
//alert(file);
if (! (ext && /^(jpg|png|jpeg|gif|JPG|PNG|JPEG|GIF)$/.test(ext))){
// extension is not allowed
return false;
}
},
onComplete: function(file, response){
alert("success");
}
});
</script>
但我不知道 ajax 是如何用于压缩文件上传的。
我应该在我的代码中更改什么?