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 listserv@(protected)
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