我已经完成了将文件保存到数据库中的操作,但是我不知道如何将文件保存到jsp文件中
public String save() throws IOException {
fileDAO dao = new fileDAO();
File file = new File("F:\\");
byte[] bFile = new byte[(int) file.length()];
try {
FileInputStream fileInputStream = new FileInputStream(file);
fileInputStream.read(bFile);
fileInputStream.close();
} catch (Exception e) {
e.printStackTrace();
}
//int userid=Integer.parseInt(request.getParameter("userid"));
String username=request.getParameter("username");
Fileupload fileupload = new Fileupload();
fileupload.setUsername(username);
fileupload.setUpload(bFile);
dao.savefileinfo(fileupload);