使用ajaxfileupload插件上传文件取不到值
不知道问题在哪,求解
就一个文件框
<input type="file" id="fuLiveD" class="fileT" />
$(".fileT").live("change", function () {
var $img = $(this).parent().parent().find("img");
var id = $(this).attr("id");
$.ajaxFileUpload({
url: "SaveFileInfo.ashx",
secureuri: false,
fileElementId: 'fuLiveD', //文件选择框的id属性
dataType: 'json', //服务器返回的格式,可以是json
success: function (data, status) {
$('#result').html('添加成功');
}
});
});
context.Response.ContentType = "text/html";
HttpFileCollection hpf = HttpContext.Current.Request.Files;
string uploadpath = context.Server.MapPath("~/Img/member");
hpf[0].SaveAs(uploadpath+"/"+hpf[0].FileName);
return hpf[0].FileName;
<input type="file" id="fuLiveD" class="fileT" name="fuLiveD" />