Hi,
I hava a jsp page which contains some file links which user can click and it
will call a servlet which will download the file the user want from the
server.

all the links for files type other than pdf will pop up the download dialog
windown which ask you where you want to save at local disk. but when I clcik
the link for pdf file downloading, it will open the pdf file right away in
the acrobat reader instead of giving user the save dialog box, so inorder to
download and save it, user have to manully point to the link and right click
mouse and choose save target to .

anyone know how to make the pdf downloading functions same as other file
types?

here is the partial code:

String fileName= req.getParameter("filename");
String filePath = req.getParameter("filepath");
String downloadFile = filePath + fileName;

res.setContentType("application/x-filler; name=" + fileName);
res.setHeader("Content-Disposition", "inline;filename="+fileName);


ServletOutputStream stream = res.getOutputStream();
BufferedInputStream fif = new BufferedInputStream(new
FileInputStream(downloadFile));

int data;
while((data = fif.read()) != -1)
{
stream.write(data);
}
fif.close();
stream.close();
}


appreciate any help.

Helen Ge

_________________________________________________________________________
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.

Share information about yourself, create your own public profile at
http://profiles.msn.com.

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets

Reply via email to