aspose file tools*
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


Win a copy of Soft Skills this week in the Jobs Discussion forum!
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: 1479
    
    6

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


Swastik
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42918
    
  68
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.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to show file(residing on server) link on HTML