You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Kavita Bansal <Ka...@intiqua.com> on 2003/02/28 07:12:20 UTC

Filedownload

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.