This is what we did in our Action:

// generate the file
File file = generate();
// download
response.setContentType("text/plain");
response.addHeader("Content-Disposition", "attachment;filename=" +
file.getName());
return new ActionForward("/logs/" + file.getName());


Thanks
 
-- pady
[EMAIL PROTECTED]
 

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, March 24, 2004 9:16 AM
To: struts-user
Subject: generating a text file

Hi all. I have to generate a text file (filled with a 
pre-formated text) after a certain action is finished. 
this file is a kind of confirmation of a certain 
business action. so, as my application is web-based, I 
think I should let the user download this text file 
when it is generated. how to automatically start the 
download? I mean ,fire up the download confirmation 
menu, so the user confirms he wants to receive the text 
file or not.

thanks in advance


Otávio Augusto 
 
__________________________________________________________________________
Acabe com aquelas janelinhas que pulam na sua tela.
AntiPop-up UOL - É grátis!
http://antipopup.uol.com.br/



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


______________________________________________________________________
This email has been scanned by the MessageLabs Email Security System.
For more information please visit http://www.messagelabs.com/email 
______________________________________________________________________

______________________________________________________________________
This email has been scanned by the Heroix e-mail Security System
______________________________________________________________________

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

Reply via email to