*
The moose likes JSP and the fly likes How to show file(residing on server) link on HTML Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark "How to show file(residing on server) link on HTML" Watch "How to show file(residing on server) link on HTML" New topic
Author

How to show file(residing on server) link on HTML

sonia chg
Greenhorn

Joined: Jul 02, 2010
Posts: 1
Hello,

I am generating an excel report from the Webapp. The application generates the excel file and save it on the server's home directory.

Now I need to show the link of this excel file on the HTML so that when the user clicks on that link the file should be opened.

Is there any way to show the link of the file if that file is not bundled inside the webapp and is residing on the home directory of the server? If not, then what could be the other approach to achieve the same.

Any help or pointers in this regard will be highly appreciated.

Thanks
Sonia
Swastik Dey
Rancher

Joined: Jan 08, 2009
Posts: 1449
    
    6

May be you could create a temp file within your web context.


Swastik
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41102
    
  45
The link could point to a servlet that streams the file to the browser. The CodeBarn has an example of how that's done. An additional benefit of that would be that the servlet could track how often the file is downloaded, or could perform access control if necessary.


Ping & DNS - my free Android networking tools app
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: How to show file(residing on server) link on HTML
 
Similar Threads
Can I get local drives of server
Calling a Excel Macro from a JSP or HTML
jsp showing directory structure
ravula62020
Regarding Excel sheel in jsp