i trying open text file jsp specifying path local drive. here code snippet doesnt working.
source bro.jsp:
<html> <body> <a href="d:/data.txt">click me</a> </body> </html>
almost similar code html extension works.
source bro.html:
<html> <body> <a href="d:/data.txt">click me</a> </body> </html>
i can understand server may not able read files local drive. hence have changed path several ways this, none of them working jsp. ideas?
<a href="//d:/data.txt">click me</a> <a href="file://d:/data.txt">click me</a> <a href="file:///d:/data.txt">click me</a> <a href="file://localhost/d:/data.txt">click me</a>
i agree answer before, , want add clarification. it's not jsp issue, , issue of http , browsers.
if create html file (not jsp) following:
<a href="file://d://data.txt">click</a>
then browser looks d: drive of local machine (e.g. home machine of user, not server). furthermore, on cases fail due browser security restrictions. want, browser ask page on server machine, , 1 solution indeed go application (href="/myapp/test/data.txt") , ask server page, assuming has it.