如何上传FLASH文件,如aa.swf??急!!!!!!

解决方案 »

  1.   

     protected void Button1_Click(object sender, EventArgs e)
        {
            string upics = "";
            if (FileUpload1.PostedFile.ContentLength != 0)
            {            if ( FileUpload1.PostedFile.ContentType == "application/x-shockwave-flash")    //设置上传文件类型
                {
                    if ((FileUpload1.PostedFile.ContentLength / 1024.0) > 150)
                    {
                        this.Label1.Text = "应小于150KB!";
                    
                   upics = "";
                                     }
                    else
                    {
                        string filename = FileUpload1.PostedFile.FileName;  //取得文件名
                        int i = filename.Length;
                        filename = filename.Remove(0, i - 4);
                        string s = DateTime.Now.Year.ToString() + DateTime.Now.Month.ToString() + DateTime.Now.Day.ToString() + DateTime.Now.Hour.ToString() + DateTime.Now.Minute.ToString() + DateTime.Now.Second.ToString() + DateTime.Now.Millisecond.ToString();
                        string d = Server.MapPath("images/upload/") + s + filename;    //设置文件名
                        FileUpload1.PostedFile.SaveAs(d);  //保存文件                                       this.Label1.Text = "上传成功!";
                    
                        upics = "../images/upload/" + s + filename;(这个为向数据库里保存的路径)
                                       }
                }
                else
                {
                    //this.TextBox1.Text = "";
                    this.Label1.Text = "格式不正确!";
                    upics = "";
                  
                  
                }
            }
            else
            {
                //this.TextBox1.Text = "";
                this.Label1.Text = "上传为空!";
                upics = "";
                
                       }
        }
      

  2.   

    楼上正解
    商机、产品、企业-51Sole 搜了网商业搜索引擎
    http://www.51sole.com