Re: providing downloading functionality for a file which is on disk

2009-07-23 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Lanxiazhi, On 7/21/2009 7:52 AM, lanxiazhi wrote: I don't have a linux at hand to prove this idea: if you're deploy your app in linux ,maybe you can use a soft link to that directory ,and put the link under your webapp's dir. hope that will help.

Re: providing downloading functionality for a file which is on disk

2009-07-21 Thread Kham Mulman
you can. for instance, File file = new File(C:\\temp\\downloadfilename.csv); FileInputStream fileIn = new FileInputStream(file); ServletOutputStream out = response.getOutputStream(); byte[] outputByte = new byte[4096]; //copy binary contect to output stream while(fileIn.read(outputByte, 0,

Re: providing downloading functionality for a file which is on disk

2009-07-21 Thread lanxiazhi
I don't have a linux at hand to prove this idea: if you're deploy your app in linux ,maybe you can use a soft link to that directory ,and put the link under your webapp's dir. hope that will help. thanks. lanxiazhi 2009/7/21 Kham Mulman kmul...@gmail.com you can. for instance, File file =

RE: providing downloading functionality for a file which is on disk

2009-07-21 Thread Caldarale, Charles R
From: Ritesh399 [mailto:ritesh...@gmail.com] Subject: providing downloading functionality for a file which is on disk I am developing a web application using jsp and want to provide some links for a user to download data. The data is not in web application's directory(somewhere else on

Re: providing downloading functionality for a file which is on disk

2009-07-21 Thread Michael Ludwig
Caldarale, Charles R schrieb: If you don't mind providing direct access to the downloadable area, one easy way to provide this is to place a Context element in conf/Catalina/[host]/[dlink].xml, where [dlink] is the URL link you want for the downloadable files. Within the Context element, place

RE: providing downloading functionality for a file which is on disk

2009-07-21 Thread Caldarale, Charles R
From: Michael Ludwig [mailto:m...@as-guides.com] Subject: Re: providing downloading functionality for a file which is on disk Is there a way of including a second context with a web application in a similarly convenient way? No. The servlet spec expects webapps to be independent of each