tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lanxiazhi <lanxia...@gmail.com>
Subject Re: providing downloading functionality for a file which is on disk
Date Tue, 21 Jul 2009 11:52:45 GMT
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 <kmulman@gmail.com>

> 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, 4096) != -1)
> {
>        out.write(outputByte, 0, 4096);
> }
> fileIn.close();
>
>
>
>
>
> On Tue, Jul 21, 2009 at 2:54 PM, Ritesh399 <ritesh399@gmail.com> wrote:
>
> >
> > Hi all
> > 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 disk)
> > Can I provide a direct link to that data file ?
> >
> >
> >
> > Thanks
> > Ritesh
> > --
> > View this message in context:
> >
> http://www.nabble.com/providing-downloading-functionality-for-a-file-which-is-on-disk-tp24582115p24582115.html
> > Sent from the Tomcat - User mailing list archive at Nabble.com.
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> > For additional commands, e-mail: users-help@tomcat.apache.org
> >
> >
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message