response.setContentType("application/octet-stream");
response.addHeader("Content-Disposition", "attachment; filename=filename.xls");
java.io.FileInputStream in = null;
try
{
in = new java.io.FileInputStream(“realpath” +"filename.xls");
byte[] buf = new byte[1024];
int l = 0;