不知道问题在哪,求解
就一个文件框
<input type="file" id="fuLiveD" class="fileT" />js这样写的$(".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;
调试运行到后台的时候hpf总是没有值,已经被折磨了一天了。javascriptajaxasp.netjquery
就一个文件框
<input type="file" id="fuLiveD" class="fileT" />js这样写的$(".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;
调试运行到后台的时候hpf总是没有值,已经被折磨了一天了。javascriptajaxasp.netjquery
解决方案 »
- 用户 'sa' 登录失败。这个怎么解决呢
- 谁能给个这样的例子啊
- AlternatingItemStyle实现Repeater交替行换色,如果是每三行换色代码怎么写?
- 如何綁定 List<User> 在DetailsView上顯示
- div 控制树形结构的问题,挺郁闷的
- ASP.Net VS AJAX
- 我的网站页面里被人放入了<iframe src="">这样一段代码,请问是如何作到的。
- 关于水晶报表的问题(如何设置自动横向打印报表)
- 请问:如何在Web应用完成之后象Winows应用程序那样打包、发布??在线等待,及时结帖!
- Repeater控件的苦恼了 :( 苦闷了! 在线等待你的回答!马上给分!
- DataList如何统计出数据库的记录数,类似GridView.Rows.Count
- 请问mvc2在2008上应该怎么部署?
给file一个name就可以了