Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

File downloading from directory external to webapp  RSS feed

 
billy thompson
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What would be the best/easiest way to provide a simple file download JSP page for files located in a directory external to my servlet webapp. So far i have been unable to setup Apache Tomcat to include desired directories with HTTP service. Apparently the easiest way is to use sendRedirect() with servlets but i can't use it unless i have files included with Tomcat so now i am looking for a workaround.
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65826
134
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can use Java file I/O to discover the files so you can provide a listing. When a file is chosen for download, a servlet can easily read the file and stream it as the response.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!