图片上传到服务器再显示
function getupFile(){
//创建FormData对象
var data = new FormData();
//为FormData对象添加数据
$.each($('#inputfile1')[0].files, function(i, file) {
data.append('file', file);
});
$.ajax({
url : HeaderUrl + "Open/Upload/UploadFile?access_token=" + token + "&type=3",
type : 'POST',
data : data,
cache : false,
contentType : false, //不可缺
processData : false, //不可缺
dataType : "json",
success:function(data){
imgPath = data.data.file_path;
if(data.message != "error"){
$(".p-upimgwrap").append('<label class="laimg-wrap"><img class="cur" src="/'+ imgPath +'"><i class="i-remove"></i></label>');
}
}
});
}