Q:代码如下:
protected void btn_upload_Click(object sender, EventArgs e)
{
HttpFileCollection files = Request.Files;
for (int iFile = 0; iFile < files.Count; iFile++)
{
HttpPostedFile postedFile = files[iFile];
string fileName;
fileName = System.IO.Path.GetFileName(postedFile.FileName);
Response.Write(fileName);
}
}
就是显示上传控件中文件的名字,在FF3下运行OK,在IE7下运行就会报错。可这个页面上个月做项目的时候还没有问题,IIS真是太奇怪了。在网上找了一下原因,最后发现是少了这行?
<httpRuntime executionTimeout="60" maxRequestLength="100000" />
可为什么前段时间不会报错呢.
<input id="File1" type="file" name="File11" />而且在前台页面html file控件必须加上name属性。不然在后台得不到值。
protected void btn_upload_Click(object sender, EventArgs e)
{
HttpFileCollection files = Request.Files;
for (int iFile = 0; iFile < files.Count; iFile++)
{
HttpPostedFile postedFile = files[iFile];
string fileName;
fileName = System.IO.Path.GetFileName(postedFile.FileName);
Response.Write(fileName);
}
}
就是显示上传控件中文件的名字,在FF3下运行OK,在IE7下运行就会报错。可这个页面上个月做项目的时候还没有问题,IIS真是太奇怪了。在网上找了一下原因,最后发现是少了这行?
<httpRuntime executionTimeout="60" maxRequestLength="100000" />
可为什么前段时间不会报错呢.
<input id="File1" type="file" name="File11" />而且在前台页面html file控件必须加上name属性。不然在后台得不到值。