I developed a web application using struts 1.2 , I need to access local files((C:\Testing) in jsp with a link format.When user clicks on a file name it automatically opens(no download option).File can be of any type(pdf,excel,.doc...) I tried
Asked
Active
Viewed 2,340 times
0

user2741923
- 23
- 6
-
I developed a web application using struts 1.2 , I need to access local files((C:\Testing\) in jsp with a link format.When user clicks on a file name it automatically opens(no download option).File can be of any type(pdf,excel,.doc...) I tried
- <%=fileName%>
and- <%=fileName%>
None of them worked..Any kind of help would be really appreciated. Thanks – user2741923 Sep 03 '13 at 23:20
1 Answers
0
Even if your HTML ended up with a correctly formatted link "C:\Testing" a remote user's browser would just interpret that as pointing to their local C drive (if they even have one).
Instead you need to implement a file download servlet:
Implementing a simple file download servlet
And in your JSP insert a link to that servlet.
-
Thanks for your reply....Sorry I want to connect to the shared drive(network), I am able to connect and open them with <%=fileName%>.....but I want when user clicks on them, IE won't ask for open,save,save as option it directly opens the file same as user clicks on any link in google for pdf it opens pdf direclty. – user2741923 Sep 05 '13 at 06:20