急救 关于页面下载
我能获取一个文件路径
怎么下载这个文件
代码怎么写
#
protected void Page_Load(object sender, EventArgs e)
{
if (Request.QueryString["Id"] != null)
{
try
{
int id = int.Parse(Request.QueryString["id"].ToString());
Files file = bll.GetModel(id);
Response.Clear();
Response.Charset = "GBK";
Response.ContentEncoding = System.Text.Encoding.UTF8;
Response.(Common.ConfigHelper.GetConfigString("UpFiles") + "/" +file.FilePath.ToString());
Response.End();
}
catch (Exception ex)
{
string err = ex.Message;
}
}
}
------解决方案--------------------
Request.Files[0].SaveAs(Server.MapPath(路径));