验证中...
Languages: JavaScript
Categories: JavaScript 工具
Latest update 2019-05-16 14:51
移动端h5上传过慢、图片太大问题
Raw Copy
function uploadback(file){
resizeImage(file).then(function (result) {
return typeof result === 'string' ? convertToBlob(result, file.type) : result;
}).then(function (blob) {
var fd = new FormData();
fd.append("back[]", blob, file.name);
$.ajax({ url: "接口",
data: fd,
dataType: "json",
method:"post",
cache:false,
traditional: true,//设置tradtional为true阻止深度序列化
contentType: false,
processData: false,//processData 默认为false,当设置为true的时候,jquery ajax 提交的时候不会序列化 data,而是直接使用data
success: function (data) {
}
})
})
}

Comment list( 0 )

You need to Sign in for post a comment

Help Search