--- "J.Pietschmann" <[EMAIL PROTECTED]> wrote:
> Nirupama Yalavarti wrote:
> > But I have programmed that the pdf is saved to
> > specific file(that is the way I want it) ie teh
> pdf
> > generated be saved as a specific file in the
> server.
> > But that doesnt seem to happen.I was expecting it
> to
> > be saved in tomcat/bin.
> > Any idea of setting something else for that?
> > Thanks
> > Nirupama
> > 
> > This what I have written:
> > 
> > ByteArrayOutputStream xslOut = new
> > ByteArrayOutputStream();
> > byte[] pdfOutData = doRenderPDF(xslOut);
> >          
> >            
> > response.setContentType("application/pdf");
> > 
> > response.setContentType("application/pdf;
> > name=\"test12.pdf\"");
> > response.setHeader("Content-Disposition",
> > "inline;filename=\"test12.pdf\"");
> 
> You should only set *one* of the above.
> 
> > response.setContentLength(pdfOutData.length);
> > 
> > OutputStream resOut = response.getOutputStream();
> > resOut.write(pdfOutData);
> > resOut.close();
> 
> Apart from this, you are writing your PDF to the
> servlet's
> output stream and therefore to the browser. The
> content-disposition setting is a hint for the
> *browser* on
> how to save the content if it chooses to.
> If you want to write to a file on the server, use
> something
> like
>   FileOutputStream fos=new
> FileOutputStream("test12.pdf");
>   fos.write(pdfOutData);
>   fos.close();
> 
> J.Pietschmann
> 
> 
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> [EMAIL PROTECTED]
> For additional commands, email:
> [EMAIL PROTECTED]
> 

Thanks , I figured that out...
I could do that..THE file is being saved in
jtomcat/bin
Is there any way to change that location? may be to
jtomcat/webapps/"deployment directory" ?


=====


__________________________________________________
Do You Yahoo!?
Yahoo! - Official partner of 2002 FIFA World Cup
http://fifaworldcup.yahoo.com

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]

Reply via email to