Sponsored Link •
|
Advertisement
|
Advertisement
|
This page contains an archived post to the Java Answers Forum made prior to February 25, 2002. If you wish to participate in discussions, please visit the new Artima Forums.
Message:
I had written following Java Download Servlet and which is working fine with Netscape but not with Internet Explorer. Problem with Internet Explorer is that while Downloading file, Instead of taking File Name it takes Servlet Name for file Downloading... Thank you very much in advance. bhaskar import java.io.*; public class fileDownload extends HttpServlet { public void doGet(HttpServletRequest req ,HttpServletResponse res) public void doPost(HttpServletRequest req ,HttpServletResponse res) res.setContentType("application/x-filler"); try { res.setHeader("Content-Disposition","attachment; filename=\"" + downloadFile + "\";"); ServletOutputStream stream = res.getOutputStream(); BufferedInputStream fif = new BufferedInputStream(new FileInputStream(downloadFile)); catch(Exception e) { finally { } catch (Exception ignore) {} }
Replies:
|
Sponsored Links
|