0
다음 코드를 사용하여 JSP에서 PDF 문서를 생성하지만 Excel 시트가 생성됩니다.ContentType은 application/pdf이지만 여전히 Excel 시트를 생성합니다.
<%@ page buffer="7024kb" %>
<%@ page contentType="application/pdf"%>
<%
String reportType=request.getParameter("reportType");
String fileName=reportType;
response.addHeader("Content-disposition", "attachment; filename="+fileName);
%>
<%= request.getParameter("file") %>
왜 이런 일이 발생하는지 알려주실 수 있습니까? 이 문제를 어떻게 해결할 수 있습니까?
파일 이름 확장자는 XLS입니까? –
파일 이름의 확장명은 .csv입니다. – Debashree