This week's book giveaway is in the Agile and other Processes forum. We're giving away four copies of The Mikado Method and have Ola Ellnestam and Daniel Brolund on-line! See this thread for details.
I have a problem. In a jsp file, I just need to put an link for a file path ( Which is stored in a different system from the webserver ) I have seen some of the examples in this forum,but I could not solve the issue.
Code:
<% ...... ...... ...... %> <td align="left" colspan = 0><b><font color=#1E2582><a href="\\192.168.10.64\Public\PCI Stock List\stock_list.xls"> Click Here To Access The File</a></font></td> <% ...... ...... ...... %>
Error:
When the jsp file is compiled and the output displayed as below, Stock List Report Successfully, Saved in - P:\PCI Stock List\stock_list.xls Click Here To Access The File
and the error when you click on the link is The requested resource (/struts-blank/searchSupplyChainMMS/%5C%5C192.168.10.64%5CPublic%5CPCI%20Stock%20List%5Cstock_list.xls) is not available.
Question:
I know there is some silly logical error, but I could not figure it out. Can anyone pls tell me how to solve this problem
And ( If possible ) i. I need to open that excel file in a Excel Rather in IE ii. I also need to open in firefox
Cheers Anand
Ulf Dittmer
Marshal
Joined: Mar 22, 2005
Posts: 35252
7
posted
0
Any file you want to downlaod via HTTP needs to be in a publicy accessible directory on that server. A file on a shared drive somewhere else may work if it is mapped to a web directory, but I'm not sure of that. But just any shared directory will not work - it needs to be in the web directory space. [ December 06, 2006: Message edited by: Ulf Dittmer ]
Remember that the browser on the client is issuing the link reference. A file path that makes sense on the server will most likely be bogus on the client.
You could either map the drive as Ulf suggested, or write a servlet that will stream the file.
I tried mapping the network... but still dont work. Anway Thanks for reply...
Ulf Dittmer
Marshal
Joined: Mar 22, 2005
Posts: 35252
7
posted
0
I tried mapping the network... but still dont work.
What does this mean? What is the path under which the mapped drive is accessible on the server, and what is the root path of the web directory?. Path #1 must be somewhere under path #2.
So you want to produce an href link to a file that's in a different server. Well, first of all that different server must be running a web server so that it can respond to HTTP requests for files. Second that web server must be configured so that it can serve that file to requests; you can't just point at files over there and hope that the web server understand what you mean, you have to provide the URL that the web server will understand.
And third, backslashes aren't valid characters in URLs.