当我尝试在本地通过 ajax 上传图像时,浏览器显示错误太多递归。所以我无法在本地测试它,但它在 heroku 上的生产中工作
$('#fileupload_pers').fileupload({
url: '/create_img_prs',
add: function (e, data) {
$('#upload_pers').html('<p class="upl label label-
success">Uploading....please wait</p>');
data.submit();
},
success: function (r) {
//$('#upload').remove();
$('#upload_pers').empty();
$('#upload_pers').html('<p class="upl label label-success">Successfully
Uploaded Image</p>') ;
$('#id_poster_pers').attr('value',r["id"]);
$('#upload_pers').fadeOut(6000);
}
});