About downloading Excel files from Linux server

it is OK to download the file locally, but what is downloaded from the Linux server is the content of the jsp page, and the content in the downloaded Excel file is the content displayed in jsp

related codes

<%

 response.setCharacterEncoding("gb2312");      
 request.setCharacterEncoding("utf-8");      
 
 if (request.getParameter("file") != null) {      
     OutputStream os = null;      
     FileInputStream fis = null;      
    try {      
         String file = request.getParameter("file");  
         String dateStr = request.getParameter("targetDate");
         //
         file = file+dateStr.replace("/", "")+".xls";
         if (!(new File(file)).exists()) {      
            System.out.println(""); 
            response.getWriter().write("");
            response.setHeader("Refresh", "2");
            return;      
         }
         System.out.println(":"+file);      
         os = response.getOutputStream(); 
         
         response.setHeader("content-disposition", "attachment;filename=" + new String(file.getBytes("gb2312"),"ISO8859-1" ));      
         response.setContentType("application/vnd.ms-excel");//      
         byte temp[] = new byte[4 * 1024];      
         fis = new FileInputStream(file);      
         int n = 0;      
         while ((n = fis.read(temp)) != -1) {      
             os.write(temp, 0, n);      
         }      
     } catch (Exception e) {      
         out.print("");      
     } finally {      
        if (os != null)      
           os.close();      
        if (fis != null)      
            fis.close();      
     }      
     out.clear();      
     out = pageContext.pushBody();      
 
 }   

what result do you expect? What is the error message actually seen?

Jsp
Mar.25,2021
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1e86461-dc1.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1e86461-dc1.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?