public void download(String downfilename, String filename, String filetype)
			throws IOException {
		java.io.File file = new java.io.File(filedir, downfilename);
		long len = file.length();
		byte a[] = new byte[600];

		FileInputStream fin = new FileInputStream(file);
		OutputStream outs = response.getOutputStream();

		response.setHeader("Content-Disposition", "attachment; filename="
				+ filename);
		response.setContentType(filetype);
		response.setHeader("Content_Lenght", String.valueOf(len));

		int read = 0;
		while ((read = fin.read(a)) != -1) {
			outs.write(a, 0, read);
		}
		outs.close();
		fin.close();
	}