cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Kavita Bansal <Kavita.Ban...@intiqua.com>
Subject Filedownload
Date Fri, 28 Feb 2003 06:12:20 GMT
Hi

How can I download a file from Web server to the client machine through
cocoon.

Thisis the way  to be done in a servlet
response.setContentType("APPLICATION/OCTET-STREAM");
response.setHeader("Content-Disposition","attachment; filename=\""+ filename
+ "\"");
java.io.FileInputStream fileInputStream =new
java.io.FileInputStream(filepath+filename);
int i;
while ((i=fileInputStream.read()) != -1) {
out.write(i);
}
fileInputStream.close();
out.close();

How is this code to be done in cocoon, since the response object in cocoon
has no function setContentType(). ????

Thanx

____________________________________________________
            INTIQUA International        
    Intelligent Solutions, Quality Execution
____________________________________________________
 
Note: The information and data contained in this message (and attachments)
may be privileged and confidential and protected from disclosure to any
party or parties apart from the intended recipient. If the reader of this
message is not the intended recipient, or an employee or agent responsible
for delivering this message to the intended recipient, you are hereby
notified that any dissemination, distribution or copying of this
communication is strictly prohibited. If you have received this
communication in error, please notify us immediately by replying to the
message and deleting it from your computer.



Mime
View raw message