Response.Clear();
//要給的實體路徑
Response.WriteFile(physicPath + fileName);
Response.ContentType = "application/vnd.ms-excel";
Response.AppendHeader("Content-Disposition", "attachment;filename=backup.Xls");
Response.Flush();
//刪除臨時文件
System.IO.File.Delete(physicPath + fileName);
Response.End();
張貼留言