I want to allow end-users of my site to download files from the server, I tried to use the classic method using 2 jsp files :
index.jsp :
<a href="download.jsp">download the file</a>
download.jsp :
<%
String filename = "file.xls";
String filepath = "C:\\Files\\";
response.setContentType("APPLICATION/OCTET-STREAM");
response.setHeader("Content-Disposition","attachment; filename=\"" + filename + "\"");
java.io.FileInputStream fileInputStream=new java.io.FileInputStream(filepath + filename);
int i;
while ((i=fileInputStream.read()) != -1) {
out.write(i);
}
fileInputStream.close();
%>
But, it's not working with 2 Page Template in Fatwire 7.6.2, Is that because I am not allowed to use reponse object in Fatwire ?