为用户下载的文件设置默认文件名
public void ProcessRequest(HttpContext context) { byte[] fileContent = GetFileContent(); context.Response.ContentType = "application/octet-stream"; string downloadName = "Medical-Evaluation-Result.xlsx"; string headerValue = string.Format("attachment; filename=\"{0}\"", downloadName); context.Response.AddHeader("Content-Disposition", headerValue); context.Response.OutputStream.Write(fileContent, 0, fileContent.Length); }

浙公网安备 33010602011771号