日期:2014-05-17 浏览次数:20513 次
<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" />