你的那个目录里面的安全属性设好没,在里面加上ereryone这个用户,然后加上所有权限,因为你在本机,用的是admin所以有权限

解决方案 »

  1.   

    我操作系统是 win 2000 personal,我在虚拟目录U的属性设置了写如,然后在img文件夹下右键--属性---共享。点共享该文件夹,点权限,,里面就有一个ereryone,在确定了。
    但是还是不行啊???
      

  2.   

    为什么不用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>");
    }
      

  3.   

    因为我现在在做一个移动项目不支持HtmlInputFile控件。