• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

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

 
sonia chg
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 1625
5
Android Java Java ME
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
May be you could create a temp file within your web context.
 
Ulf Dittmer
Rancher
Posts: 42968
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic