Downloading excel file with diff name as jsp
Hi friends,
I need to download an excel file .The link for it is on jsp page. When the user clicks on download, the default filename that is displayed in the dialog box will be the same as my jsp page . I need to replace that name which I need to generate at runtime.I'm using POI API while writing into that excel file .
Pls provide me with solution ASAP.
Thanks
Hello,
I have used this piece of code to download pdf files:
download.jsp:
<%@ page contentType="application/pdf;charset=TIS-620" %><% response.setHeader("Content-Disposition","attachment; filename="+request.getParameter("id").substring(request.getParameter("id").lastIndexOf("/")+1));
%><jsp:include page='<%= "/WEB-INF/supporting-files/PDFs/"+request.getParameter("id") %>'/>
Hope you can adapt it to your needs. If its not clear, let me know.
Regards,
OO