Article View: borland.public.jbuilder.java.api
Article #2971Transfer Binary from Server to Client
From: Hans Georg Frey
Date: Tue, 09 Jun 1998 00:00
Date: Tue, 09 Jun 1998 00:00
35 lines
1492 bytes
1492 bytes
Hi,
I have a trusted Applet which should transfer a Word-Document
from Server to Client. I use the following code:
byte byBuffer[] = new byte[1024];
urlLink = new URL( "http://" + m_BD.SERVER_NAME + "/" +
m_BD.SERVER_ROUTE_DIR
+ "/" + m_sPrjNummer + "/" + sDateiName );
urlCon = urlLink.openConnection();
is = urlCon.getInputStream();
fos = new FileOutputStream( sDirectory + "/" + sFile );
int i = is.read( byBuffer );
while( i != -1 )
{
fos.write( byBuffer );
i= is.read( byBuffer );
}
is.close();
fos.close();
On my developing machine everything works fine, but using a test machine
with
Netscape 4.04 and JDK 1.1.4 I get a ccorrupted file. There are
differnences
at the beginning and at the end of the file.
Has anyone a good idea whats wrong? Is there a other way to transport
binary data? Is the JDK Netscape is using buggy?
Thank you, by
Hans Georg Frey
Technical Details
Message-ID:
<357D9E13.FE4@she.de>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailShow Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 1089d0,312b493cb673ac36,start X-Google-Attributes: gid1089d0,public From: Hans Georg Frey <hfrey@she.de> Subject: Transfer Binary from Server to Client Date: 1998/06/09 Message-ID: <357D9E13.FE4@she.de> X-Deja-AN: 361297693 Content-Transfer-Encoding: 7bit Mime-Version: 1.0 Reply-To: hfrey@she.de Content-Type: text/plain; charset=us-ascii Organization: ShE GmbH Newsgroups: borland.public.jbuilder.java.api