Title: Message
No, there's no way to do so without installing code on the client side. Also, this type of query should be best addressed at JSP-INTEREST; here's a link for you to subscribe there:
 
 
HTH,
 
 
Juan Pablo Lorandi
Chief Software Architect
Code Foundry Ltd.

Barberstown, Straffan, Co. Kildare, Ireland.
Tel: +353-1-6012050  Fax: +353-1-6012051
Mobile: +353-86-2157900
www.codefoundry.com
 
Disclaimer:
 
Opinions expressed are entirely personal and bear no relevance to opinions held by my employer.
Code Foundry Ltd.'s opinion is that I should get back to work.
-----Original Message-----
From: A mailing list for Enterprise JavaBeans development [mailto:[EMAIL PROTECTED]] On Behalf Of ssmtech
Sent: Wednesday, February 05, 2003 10:23 AM
To: [EMAIL PROTECTED]
Subject: Downloading a Txt File from Server to Client Desktop Directly Without opening Dialog box

Hello Sir,
        I am working on EJB and  using the following Code to Download a Text File from a particular
Directory on the Server to any where the user need to download it through the Dialouge box...
But what i Really want to achieve is that the user should not be asked for an Dialouge box, instead it
should Download the Text file directly to "Desktop"(By Default)...without opening the dialog box..
 
That is i want to Bypass the Opening of DialogBox step and display a message to the User that the file has been downloaded to the desktop....

Is there a way to do so...if yes can anybody help me out with the solution...
 
<Code>
 
public HttpServletResponse doDownloadFile(HttpServletRequest req,HttpServletResponse res)throws ServletException,IOException {
  
ServletOutputStream stream = null;  
res.setContentType("application/binary");
 
String fname1 = req.getParameter("BusinessId");
String fname2 = req.getParameter("AccountUserId");
String fname =fname1+"-"+fname2+".txt";
res.setHeader("Content-Disposition","inline; filename=\""+fname+"\";");
 
BufferedInputStream bif = null;  
try {
bif = new BufferedInputStream(new FileInputStream("C:/ABCD/download/XYZ/"+fname));   
stream = res.getOutputStream();
byte [] buf = new byte[20480];
int data;
while(( data = "" != -1) {
stream.write(buf, 0, data);
stream.flush();    
}
bif.close();
stream.close();   
return res;
} catch(Exception e) {
System.out.println("The Exception in MainServlet is :"+e);
}
finally {
if (stream != null)
stream.close();
return res;
}
}//end of method
 
</Code>
 
Any suggestions are greatly appreciated..
Thanks a million in advance,
Regards
Sam

Reply via email to