上传问题请net_lover(孟子E章) 回答?谢谢分不够再给,,, 你的那个目录里面的安全属性设好没,在里面加上ereryone这个用户,然后加上所有权限,因为你在本机,用的是admin所以有权限 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 我操作系统是 win 2000 personal,我在虚拟目录U的属性设置了写如,然后在img文件夹下右键--属性---共享。点共享该文件夹,点权限,,里面就有一个ereryone,在确定了。但是还是不行啊??? 为什么不用HtmlInputFile控件呢!try { string FileName; //upfile.PostedFile.ContentLength FileName = GetFileName(upfile.PostedFile.FileName); //判断文件是否存在 if (upfile.PostedFile.ContentLength == 0) Response.Write("<script>alert('请先选择一个有效的文件');</script>"); else { //判断文件名是否一样 if (!CheckFileName(FileName)) { //判断服务器上是否已经存在该文件 if(CheckFile(FileName,DropLocArea.SelectedItem.Value,this.DropDownList2.SelectedItem.Value +this.DropDownList3.SelectedItem.Value)) { upfile.PostedFile.SaveAs(this.m_attrpath+"upload\\ftp\\" + FileName); ListItem li = new ListItem(); //加上文件大小 li.Text = "<a href='" + MapAttrPath(this.m_attrpath+"upload\\hn"+this.DropLocArea.SelectedItem.Value+"ftp\\") + FileName + "' target='_blank'>" + FileName + "(" + ByteToK(upfile.PostedFile.ContentLength, 2) + "K)</a>"; li.Value = this.m_attrpath +"upload\\hn"+this.DropLocArea.SelectedItem.Value+"ftp\\" + FileName; chklistAttr.Items.Add(li); } else { Response.Write("<script>alert('你上传的文件不符合规范,请确认后再上传!');</script>"); } } else { Response.Write("<script>alert('已经存在该文件"+FileName+",不允许上传同名文件');</script>"); } } } catch(System.Exception err ) { string error=err.Message; Response.Write("<script>alert('请先选择一个有效的文件!');</script>"); } 因为我现在在做一个移动项目不支持HtmlInputFile控件。 asp.net excel的导入问题 C#winform程序弹出异常:系统找不到指定的文件 .Net 正则表达式如何匹配从1到40之间的数组 求解怎样实现一般控件跟随“光标”动态移动? C#FTP上传现在整个文件夹 C# float值运算的问题 C#中字符怎么转换为时间 关于软件体系结构的问题 .ascx用户控件文件有什么作用?跟aspx有什么区别?? 求大神解答!关于一个字符串的取值问题,怎么从一个字符串取出两段数字并存在2个变量里 有没有用c#写的读取mp3的tag信息的例子啊? 急!!!我现在要用asp.net做一个查询系统,谁有这方面的程序可以提供啊?
但是还是不行啊???
try
{
string FileName;
//upfile.PostedFile.ContentLength
FileName = GetFileName(upfile.PostedFile.FileName);
//判断文件是否存在
if (upfile.PostedFile.ContentLength == 0)
Response.Write("<script>alert('请先选择一个有效的文件');</script>");
else
{
//判断文件名是否一样
if (!CheckFileName(FileName))
{
//判断服务器上是否已经存在该文件
if(CheckFile(FileName,DropLocArea.SelectedItem.Value,this.DropDownList2.SelectedItem.Value +this.DropDownList3.SelectedItem.Value))
{
upfile.PostedFile.SaveAs(this.m_attrpath+"upload\\ftp\\" + FileName);
ListItem li = new ListItem();
//加上文件大小
li.Text = "<a href='" + MapAttrPath(this.m_attrpath+"upload\\hn"+this.DropLocArea.SelectedItem.Value+"ftp\\") + FileName + "' target='_blank'>" + FileName + "(" + ByteToK(upfile.PostedFile.ContentLength, 2) + "K)</a>";
li.Value = this.m_attrpath +"upload\\hn"+this.DropLocArea.SelectedItem.Value+"ftp\\" + FileName;
chklistAttr.Items.Add(li);
}
else
{
Response.Write("<script>alert('你上传的文件不符合规范,请确认后再上传!');</script>");
}
}
else
{
Response.Write("<script>alert('已经存在该文件"+FileName+",不允许上传同名文件');</script>");
}
}
}
catch(System.Exception err )
{
string error=err.Message;
Response.Write("<script>alert('请先选择一个有效的文件!');</script>");
}