commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Rick Herrick" <r...@violetshivers.com>
Subject Re: [net] "truncated server reply" on FTPClient.storeFile
Date Thu, 21 Jul 2005 20:23:52 GMT
Larry Streepy said:
>FTPClient ftp = getFtpConnection();
>
>// Open a stream to read the file
>File localFile = new File(localDir, fileName);
>InputStream localStream = new FileInputStream(localFile);
>
>// Send the file
>_ftpResults.setOperation("PUT: " + fileName + " --> " +
> _config.getServerName());
>ftp.storeFile(fileName, localStream);

My guess is that at this point you need to do this:

ftp.completePendingCommand();

Basically, it should complete the transaction with the server and get the
appropriate response back, eliminating that truncated server reply.

>localStream.close();


-- 
Rick Herrick
rick@violetshivers.com

I haven't got time for inner peace.

Get out of control, but appear under control. It's not bad to alarm other
people, though--it's good for them.--Hunter S. Thompson

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org


Mime
View raw message