Re: Problem sending .exe file through servlet to client

"Felmey, Jonathan" <[email protected]>
Newsgroups gmane.comp.java.sun.servlet
Message-ID <[email protected]>
JC, 

Sorry, I forgot to add that to the list, but I have tried that as well.

Jon Felmey
Progeny Systems Corporation
(703) 368-6107 x196


-----Original Message-----
From: Jean-Christophe CHARVY [mailto:[email protected]]
Sent: Friday, July 11, 2003 09:09
To: [email protected]
Subject: RE: Problem sending .exe file through servlet to client



Hi Jon,

Try this : response.setContentType( "application/octet-stream" );

Hope this helps,
JC

---------- Entête Initiale  -----------

De    : "A mailing list for discussion about Sun Microsystem's Java               Servlet API Technology." <[email protected]>
A     : [email protected]
Copie : 
Date  : Fri, 11 Jul 2003 08:51:24 -0400
Objet : 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
> 
> 
------------------------------------------

Faites un voeu et puis Voila ! www.voila.fr 


___________________________________________________________________________
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
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.