XML 解析错误:未找到元素 位置:http://localhost:2625/Handler3.ashx 行 1,列 1:
一个script文件 一个ashx 用来上传文件。文件能上传,但是传完会报这个错误
怎么解决?
//script
$(document).ready(function () {
$("#btnUpLoad").click(function () {
$("#form1").ajaxSubmit({
url: "Handler3.ashx",
type: "post",
resetForm: "true",
beforSubmit: function () {
},
success: function (msg) {
return true;
},
error: function (jqxhr, errorMsg, errorThrown) {
return false;
}
})
});
})
//ashx
HttpPostedFile upFile = HttpContext.Current.Request.Files["upLoad"];
if (upFile.ContentLength> 0)
{
try
{
upFile.SaveAs(context.Server.MapPath("~/") + upFile.FileName);
}
catch (Exception)
{
throw;
}