Why are you wrapping the output stream with a "buffered" output stream?
I believe that most containers buffer the output stream anyway and automatically 
flushes when your servlet returns to the container.


-----Original Message-----
From: Adrian Janssen [mailto:[EMAIL PROTECTED]
Sent: Friday, July 11, 2003 9:05 AM
To: [EMAIL PROTECTED]
Subject: Re: Problem sending .exe file through servlet to client


Have you tried explicitly flushing the BufferedOutputStream out?

> -----Original Message-----
> From: Felmey, Jonathan [SMTP:[EMAIL PROTECTED]
> Sent: 11 July 2003 02:51
> To:   [EMAIL PROTECTED]
> Subject:      Problem sending .exe file through servlet to client
>
> I am trying to send an installAnywhere exe file through a servlet to a
> client machine.  The file is sent but once it is downloaded to the
> client's machine, you get the following InstallAnywhere error, "There
was
> no compressed file in this executable.  Please get another copy of the
> installer and try again."  Should I be treating this type of file as a
zip
> file?  The file on the client is 1KB smaller than the one on our server.
> Here is the code that I am using:
>
>             System.out.println("Starting...");
>             File file = new File("/installfile.exe");
>             BufferedOutputStream out = new BufferedOutputStream(
> response.getOutputStream() );
>
>             response.setContentType( "application/zip" );
>             response.setHeader("Content-Disposition","attachment;
> filename=\"" + file.getName() + "\"");
>
>             BufferedInputStream in = new BufferedInputStream( new
> FileInputStream( file ) );
>             int c;
>             while( ( c = in.read() ) != -1 ) out.write( c );
>             in.close(); in = null;
>             System.out.println("Finished.");
>
> As far as content type, I have also tried application/application,
> application/binary, application/unknow.  Has anybody had any experiences
> similar to this?  I would be grateful for any help.
>
> Thanks.
>
> Jon Felmey
> Progeny Systems Corporation
> (703) 368-6107 x196
>
>
__________________________________________________________________________
> _
> 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
--

It is the strict policy of Truworths that its e-mail facility and all
e-mail communications emanating therefrom, should be utilised for
business purposes only and should conform to high professional and
business standards.   Truworths has stipulated certain regulations in
terms whereof strict guidelines relating to the use and content of
e-mail communications are laid down. The use of the Truworths e-mail
facility is not permitted for the distribution of chain letters or
offensive mail of any nature whatsoever.   Truworths hereby distances
itself from and accepts no liability in respect of the unauthorised
use of its e-mail facility or the sending of e-mail communications
for other than strictly business purposes.   Truworths furthermore
disclaims liability for any  unauthorised instruction for  which
permission was not granted.    Truworths Limited accepts no liability
for any consequences arising from or as a result of reliance on this
message unless it is in respect of bona fide Truworths business for
which proper authorisation has been granted.

Any recipient of an unacceptable communication, a chain letter or
offensive material of any nature is requested to notify the Truworths
e-mail administrator ([EMAIL PROTECTED]) immediately in order that
appropriate action can be taken against the individual concerned.

__________________________________________________________________________
_
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

DISCLAIMER:
The information contained in this e-mail may be confidential and is
intended solely for the use of the named addressee. Access, copying or
re-use of the e-mail or any information contained therein by any other
person is not authorized. If you are not the intended recipient please
notify us immediately by returning the e-mail to the originator.
 
DISCLAIMER: 
The information contained in this e-mail may be confidential and is intended solely 
for the use of the named addressee. Access, copying or re-use of the e-mail or any 
information contained therein by any other person is not authorized. If you are not 
the intended recipient please notify us immediately by returning the e-mail to the 
originator.
 

 
{.n+zw^bڽ.&jwbnu觶ܨ~^,j       }ERLSL
܆+޲mڭb#jw(rzzzا޲mT^q!6j˧rlǫWmzږzmRI4EQޖm
%rj[?ǫf

Reply via email to