111,094
社区成员




protected void DownLoadButton_Click(object sender, EventArgs e)
{
string fileName = _sourcename;//客户端保存的文件名
string str = _videoUrl;
string[] strFen = str.Split('/');
string filePath = Server.MapPath("VideoSource/" + strFen[1]);//路径
FileInfo fileInfo = new FileInfo(filePath);
Response.Clear();
Response.ClearContent();
Response.ClearHeaders();
Response.AddHeader("Content-Disposition", "attachment;filename=" + fileName);
Response.AddHeader("Content-Length", fileInfo.Length.ToString());
Response.AddHeader("Content-Transfer-Encoding", "binary");
Response.ContentType = "application/octet-stream";
Response.ContentEncoding = System.Text.Encoding.GetEncoding("gb2312");
Response.WriteFile("VideoSource\\" + strFen[1]);
Response.Flush();
Response.End();
}