报 404  不知道为什么??    
404 - 找不到文件或目录。
您要查找的资源可能已被删除,已更改名称或者暂时不可用。求高手

解决方案 »

  1.   

    调试到上传路径。。看看你的传路径对不对。还有就是文件过大。要在webconfig中配置。
      

  2.   

     FileUpload1.PostedFile.SaveAs(save + FileUpload1.FileName); 这样写的 路径我不知道在外网怎么写?  我在webconfig 配置了 。  在本地测试很好一直能用
      

  3.   

    检查上传文件大小,设置httpruntime
      

  4.   

    <httpRuntime executionTimeout="100" maxRequestLength="409600 " useFullyQualifiedRedirectUrl="true " minFreeThreads="18 " minLocalRequestFreeThreads="15 " appRequestQueueLimit="150 " enableVersionHeader="true "/>  写了 不是这个问题  是路径问题
      

  5.   

    我上传的才  5MB 我设置大小是 40mb
      

  6.   

    asp.net夜话之六:asp.net基本控件asp.net 服务器控件是微软为了方便开发者开发而推出的一系列控件,它们都以类似的方式出现在Visual Studio 2005的源视图里,*代表了控件名,如就表示这是一个Button控件。asp.net服务器控件除了提供HTML服务器控件所能提供的功能之外,还有很多功能更为复杂的控件。这些控件可以分为简单控件、容器控件、数据绑定控件、数据源控件和数据验证控及用户自己根据自己业务需要将一些控件组合在一起组成的用户控件等。asp.net控件的特点与HTML服务器控件类似,也有如下特点:(1)asp.net服务器控件必须有一个在当前页面中唯一的ID属性和runat=”server”属性;(2)asp.net服务器控件必须放在服务器端表单中;(3)asp.net服务器控件最终会被解释成普通 HTML标记发送到客户端浏览器。本文主要介绍以下控件:Button控件TextBox控件Web服务器控件的特殊客户端事件FileUpload控件 Literal控件Panel控件PlaceHolder控件
      

  7.   


       1. using System;
       2. using System.Data;
       3. using System.Configuration;
       4. using System.Collections;
       5. using System.Web;
       6. using System.Web.Security;
       7. using System.Web.UI;
       8. using System.Web.UI.WebControls;
       9. using System.Web.UI.WebControls.WebParts;
      10. using System.Web.UI.HtmlControls;
      11. public partial class Upload : System.Web.UI.Page
      12. {
      13.     protected void Page_Load(object sender, EventArgs e)
      14.     {
      15.     }
      16.     protected void btnUpload_Click(object sender, EventArgs e)
      17.     {
      18.         //判断是否上传了文件
      19.         if (fileUpload.HasFile)
      20.         {
      21.             //指定上传文件在服务器上的保存路径
      22.             string savePath = Server.MapPath("~/upload/");
      23.             //检查服务器上是否存在这个物理路径,如果不存在则创建
      24.             if (!System.IO.Directory.Exists(savePath))
      25.             {
      26.                 //需要注意的是,需要对这个物理路径有足够的权限,否则会报错
      27.                 //另外,这个路径应该是在网站之下,而将网站部署在C盘却把上传文件保存在D盘
      28.                 System.IO.Directory.CreateDirectory(savePath);
      29.             }
      30.             savePath = savePath + "\\" + fileUpload.FileName;
      31.             fileUpload.SaveAs(savePath);//保存文件
      32.             //不过需要注意的是,在客户端访问却需要指定的是URL地址,而不是在服务器上的物理地址
      33.             literal.Text = string.Format("<a href='upload/{0}'>upload/{0}</a>", fileUpload.FileName);
      34.         }
      35.     }
      36. }
      

  8.   

    路径我这样写的   FileUpload1.PostedFile.SaveAs(save + FileUpload1.FileName);  不行
      

  9.   

            if (FileUpload1.PostedFile.FileName != "" && FileUpload2.PostedFile.FileName != "")
            {
                string PPTpath = FileUpload1.PostedFile.FileName;
                string SWFpath = FileUpload2.PostedFile.FileName;
                string pptName = FileUpload1.FileName;
                string swfName = FileUpload2.FileName;
                string pt = pptName.Substring(pptName.LastIndexOf("."));
                string sf = swfName.Substring(swfName.LastIndexOf("."));
                if (pt != ".ppt" || sf != ".swf")
                {
                    Response.Write("<script>alert('请检查文件类型是否匹配!)</script>");
                }
                else
                {
                    string save = Server.MapPath("~/Accessory/");
                    if (File.Exists(save + FileUpload1.FileName))
                    {
                        Response.Write("<script>alert('PPT文件已经存在!')</script>");
                    }
                    else if (File.Exists(save + FileUpload2.FileName))
                    {
                        Response.Write("<script>alert('SWF文件已经存在!')</script>");
                    }
                    else
                    {
                        FileUpload1.PostedFile.SaveAs(save + FileUpload1.FileName);
                        FileUpload2.PostedFile.SaveAs(save + FileUpload2.FileName);
                        SqlConnection conn = new SqlConnection("Data Source=192.168.1.108\\sqlexpress;Initial Catalog=MNManagerDB;User ID=sa;password=123456");
                        conn.Open();
                        SqlCommand comm = new SqlCommand("insert into uploading(norm,category,brand,region,pptName,swfName,describe,dateTime,department,uploadingPerson,state) values('" + norm + "','" + category + "','" + brand + "','" + region + "','" + pptName + "','" + swfName + "','" + describe + "','" + time + "','" + department + "','" + uploadingPerson + "'," + state + ")", conn);
                        comm.ExecuteNonQuery();
                        conn.Close();
                        Response.Redirect("TreePPt.aspx");
                    }
                }
            }