I don't mean this, i would like to generate a excel file on fly.
-----Original Message-----
From: A mailing list for discussion about Sun Microsystem's Java Servlet API
Technology. [mailto:[EMAIL PROTECTED]]On Behalf Of Vyacheslav
Pedak
Sent: Tuesday, April 04, 2000 12:20 PM
To: [EMAIL PROTECTED]
Subject: Re: Generating response of MIME type "application/ms-excel"
If you have excel file in web server you can try something like this:
buf = new byte[1024];
res.setContentType("application/ms-excel");
res.setHeader("Content-disposition", "attachment;filename=file.xls");
fileOut = response.getOutputStream();
fileIn = new BufferedInputStream(new FileInputStream("file.xls"));
do {
int ret = fileIn.read(buf, 0, buf.length);
if (ret != -1) {
fileOut.write( buf, 0, ret);
}
} while (ret == buf.length);
fileOut.close();
fileIn.close();
Vyacheslav Pedak
----- Original Message -----
From: Alvin Lau <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, April 04, 2000 2:33 PM
Subject: Re: Generating response of MIME type "application/ms-excel"
> I would like to have such infomation too.
>
> -----Original Message-----
> From: A mailing list for discussion about Sun Microsystem's Java Servlet
API
> Technology. [mailto:[EMAIL PROTECTED]]On Behalf Of Sateesh
Kumar
> .K
> Sent: Tuesday, April 04, 2000 8:56 AM
> To: [EMAIL PROTECTED]
> Subject: Generating response of MIME type "application/ms-excel"
>
>
> Hi all
> Could anybody explain (if possible send a sample working program) to
> generate response of content-type application/ms-excel, meaning that the
> response of the servlet should be an Excel sheet. Please help me in this
>
> regard
>
> Thanks
> Sateesh.
>
>
___________________________________________________________________________
> To unsubscribe, send email to [EMAIL PROTECTED] and include in the
body
> of the message "signoff SERVLET-INTEREST".
>
> Archives: http://archives.java.sun.com/archives/servlet-interest.html
> Resources: http://java.sun.com/products/servlet/external-resources.html
> LISTSERV Help: http://www.lsoft.com/manuals/user/user.html
>
>
___________________________________________________________________________
> To unsubscribe, send email to [EMAIL PROTECTED] and include in the
body
> of the message "signoff SERVLET-INTEREST".
>
> Archives: http://archives.java.sun.com/archives/servlet-interest.html
> Resources: http://java.sun.com/products/servlet/external-resources.html
> LISTSERV Help: http://www.lsoft.com/manuals/user/user.html
>
___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".
Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html
___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".
Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html