我正在发送一个带有 http 响应的 excel 文件,当单击“打开”时,IE 在文件名的末尾添加了一个 [1]。在“保存”文件中它没有。有没有办法解决它?
HttpResponse response = HttpContext.Current.Response;
response.Clear();
response.AddHeader("content-disposition", "attachment;filename=" + filename+".xlsx");
response.ContentType = "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet";
response.ContentEncoding = System.Text.Encoding.Unicode;
response.BinaryWrite(pkg.GetAsByteArray()); //pkg is ExcelPackage
response.End();