Ajax上传file出现的bad request问题

var formData = new FormData($("#form")[0]);
               $.ajax({
                   url:'${pageContext.request.contextPath}/manage/matrix/add',
                   type:'post',
                   data:formData,
                   async : false,
                   cache : false,
                   contentType : false,
                   processData : false,
                   success:function(data){
                       myAlert(data.message,function(){
                           window.location.href="${pageContext.request.contextPath}/manage/matrix/list";
                       });
                   },
                   error:function(){
                       myAlert("网络错误",function(){
                               window.location.href="${pageContext.request.contextPath}/manage/matrix/list";
                       });
                   }
               });

 

转载于:https://www.cnblogs.com/zhengyuanyuan/p/9565927.html

你可能感兴趣的:(Ajax上传file出现的bad request问题)