开发者

How to put the url path to the specific files in server using JSP?

开发者 https://www.devze.com 2023-04-03 05:08 出处:网络
I want to send the link which contains a path to the any file that is located in Server whenever user clicks the button. How can I do this in JSP?

I want to send the link which contains a path to the any file that is located in Server whenever user clicks the button. How can I do this in JSP?

For example, my file is stored in web-inf/temp0001111/JspContext.pdf.

So, whenever user click this link, then this file get downloaded in开发者_开发问答to browser and allow the user to save.and also need to specify the life time of this link is to only 3 days.

How can I achieve this?


the path under WEB-INF is not publicly visible so user can't simply GET it, you need to write a custom servlet which serve your purpose

0

精彩评论

暂无评论...
验证码 换一张
取 消