//using System;
//using System.Collections.Generic;
//using System.Linq;
//using System.Web;
//using System.Web.UI;
//using System.Web.UI.WebControls;
//using System.IO;
//using System.Configuration;
//using System.Data;
using System;
using System.Collections.Generic;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;
using System.Configuration;
using System.IO;
public partial class YZSoft_Forms_XForm_测试_UploadDocument : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {

    }
    protected void Upload_Click(object sender, EventArgs e)
    {
        
        var file = Request.Files["file"];
        if (Request.Files["file"].ContentLength > 0)
        {
            string fileName = System.IO.Path.GetFileName(file.FileName); //文件原名
            long fileSize = file.ContentLength;
            string fileExt = System.IO.Path.GetExtension(fileName).ToLower();
            string path=null; //文件路径
            if (!Directory.Exists(path))  //如果不存在路径
            {
                Directory.CreateDirectory(path);    //创建路径
            }
            Request.Files["file"].SaveAs(Server.MapPath("~/") + Path.GetFileName(Request.Files["file"].FileName));  //上传

        }
       

    }
}