在FF、Chrome 下是正常的
IE下就是获取不到 Request.file 没有文件
代码如下JS
function people_modif() {
var vURL = "admin_action.ashx?&rand=" + Math.random();
$("#peopledetail").ajaxSubmit({
url:encodeURI(vURL),
type: "post",
dataType: "text",
success: function (str) {
},
error: function (error) {
}
});
}HTML:
<div style=" float:left">更新图片:<input id="popmodifimage" type="file" name="popmodifimage" /></div>后台代码 action.ashxHttpPostedFile pf = Request.Files["popmodifimage"];
if (pf != null)
{
string fileExtension = System.IO.Path.GetExtension(pf.FileName); //上传文件的扩展名
if (fileExtension != ".jpg" && fileExtension != ".gif" && fileExtension != ".bmp" && fileExtension != "png")
{
Response.Write("-1");
return;
}
fileName = DateTime.Now.ToString("yyyyMMddHHmmss") + fileExtension; //给文件重新命名
pf.SaveAs(path + fileName); if (mpopimgurl != "") File.Delete(path + mpopimgurl);
strimg = " ,ImageUrl=@imageurl ";
}
IE下就是获取不到 Request.file 没有文件
代码如下JS
function people_modif() {
var vURL = "admin_action.ashx?&rand=" + Math.random();
$("#peopledetail").ajaxSubmit({
url:encodeURI(vURL),
type: "post",
dataType: "text",
success: function (str) {
},
error: function (error) {
}
});
}HTML:
<div style=" float:left">更新图片:<input id="popmodifimage" type="file" name="popmodifimage" /></div>后台代码 action.ashxHttpPostedFile pf = Request.Files["popmodifimage"];
if (pf != null)
{
string fileExtension = System.IO.Path.GetExtension(pf.FileName); //上传文件的扩展名
if (fileExtension != ".jpg" && fileExtension != ".gif" && fileExtension != ".bmp" && fileExtension != "png")
{
Response.Write("-1");
return;
}
fileName = DateTime.Now.ToString("yyyyMMddHHmmss") + fileExtension; //给文件重新命名
pf.SaveAs(path + fileName); if (mpopimgurl != "") File.Delete(path + mpopimgurl);
strimg = " ,ImageUrl=@imageurl ";
}
解决方案 »
- asp.net中关于session的问题
- 关于.net 加密MD5的问题
- 关于ASP.NET中针对用户保存和读取cookie问题
- 同一命名空间,同类的方法调用怎么报错,说要“对象引用”,这是为什么?
- 求一高难度javascript算法(散分)
- datagrid的checkbox问题!
- SQL server connection 的问题, 十分急! (*******出手从来都是100分*********)
- AJAX怎么下载``里面的英语看不懂哦
- 招工程项目!门户网站2000起-工程项目以成本价算,另招开发队员。
- ComponentArt 控件效率问题,有人用过吗
- asp.net页面的问题
- div+js弹出层效果
http://topic.csdn.net/t/20061107/22/5140788.html