|
上传多张图片,也是总报这个错误,请求支援
var url = "http://211.91.254.130:11010/pic/uploadPicBase64";
var picBase64Str = files[parseInt(step)].picBase64Str;
var file_path = files[parseInt(step)].imageName;
api.ajax({ //异步执行
"url": url,
// "url": ImageUrl,
method: 'post',
timeout:600,
async: false,
headers: {
"Content-Type": "application/x-www-form-urlencoded",
},
data: {
values: {
"picBase64Str": files[parseInt(step)].picBase64Str,
"file_path": files[parseInt(step)].imageName,
}
},
}, function (ret, err) {
console.log("upload image ret:" + parseInt(step) + " " + JSON.stringify(ret));
console.log("upload image err:" + parseInt(step) + " " + JSON.stringify(err));
if (err) {
// console.log("base64 err:" + picBase64Str);
alert("图片上传失败,请重试:" + JSON.stringify(err.msg));
api.hideProgress();
return;
} else {
console.log("image upload success,step:" + parseInt(step) + " name:" + files[parseInt(step)].imageName);
fnUploadImages(files, parseInt(step) + 1);
}
}) |
|