response.setHeader("content-disposition", "attachment;filename="filename");
                         RandomAccessFile out = new RandomAccessFile(fileName, "r");
                         byte[] line = new byte[ (int) out.length()];
                         saveasout.read(line);
                         response.getOutputStream().write(line);
                         out.close();