retrieving files from database by their path in jsp

前端 未结 2 1394
梦谈多话
梦谈多话 2021-01-27 23:38

i want to download a file by its path(local server path) which is stored in a database table ,i have done the coding part to view the database in a html table but i dont have an

2条回答
  •  遥遥无期
    2021-01-28 00:13

    If the rs.getString("file_path") returns a path is /home/Desktop/output/something.jpeg means you cannot download.Because when you click the given link surely it will show PAGE NOT FOUND (404) Exception.

    "> click here to download the file

    please note your URL it will look like

    http://localhost:8080/prjname/home/Desktop/output/something.jpeg

    So in this situation we can pass the path into one servlet ,through this servlet we can download the file.

提交回复
热议问题