See this problem comes when you use PDF for downloading but solution is
there in browser only. It opens the PDF file in browser with all tools
which has SAVE tool as well see carefully u'll get it. It won't open
this in browser only when Acrobat Reader is not installed in ur system
and then only it will as for save
Naveen Gupta
Web Developer
Go4i.com (India) Pvt. Ltd.
2nd Floor,Kamal Cinema Building,
Safdarjung Enclave
New Delhi-110029
Phone:6100013-14,6171893-94
Fax:6100015
Email:[EMAIL PROTECTED] <mailto:Email:[EMAIL PROTECTED]>
-----Original Message-----
From: hua ge [mailto:[EMAIL PROTECTED]]
Sent: Friday, September 08, 2000 7:31 PM
To: [EMAIL PROTECTED]
Subject: download pdf file from servlet
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
===========================================================================
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