1.通过byte[]下载文件
public void FileDownLoadByByte(byte[] fileData, string fileName) { Response.Clear(); Response.ClearHeaders(); Response.Buffer = true; Response.ContentType = "application/octet-stream"; Response.AppendHeader("Content-Disposition", "attachment;filename=" + HttpUtility.UrlEncode(fileName, System.Text.Encoding.UTF8)); Response.AppendHeader("Content-Length", fileData.Length.ToString()); Response.BinaryWrite(fileData); Response.Flush(); Response.End(); }