commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
Subject Re: RE: [net] "truncated server reply" on FTPClient.storeFile
Date Sun, 22 Jun 2008 16:31:48 GMT

I am newbie. I am facing the same problem when trying to transfer many files through single
instance of FTPClient using storefile method. It is throwing the error: Truncated Server Reply.
I dont know how to handle this situation. On the otherhand, I am able to transfer many files
by having separate instance of FTPclient for each file transfer. But this is too expensive.
I will end up in having many instances of FTPclient, which i dont want to do. For example,
1000 FTPClient Instances will be created for 1000 file transfer.

Can someone help me in solving this situation?


-- Larry Streepy wrote : 
Ok, I figured this out.  It was a subtle timing problem stemming from the
fact that I run the FTP actions on separate threads.  A second operation was
being initiated before the storeFile was complete :-(

Everything is working fine now.


-----Original Message-----
From: Larry Streepy [mailto:lstreepy@Flag...] 
Sent: Thursday, July 21, 2005 4:01 PM
To: commons-user@jaka...
Subject: [net] "truncated server reply" on FTPClient.storeFile

I'm using version 1.4.

Every time I try to use the storeFile method, I get a
MalformedServerReplyException with the message "Truncated server reply:" at
line  I have tried to send a file to 4 different servers and I
get the same error every time.  I have searched all the archives I can find,
and I find no mention of a problem like this.

Any ideas?

I'm assuming it's something on my (client) end since it occurs on every
server I try.  Further, trying a command line ftp utility and 'put'ting a
file works just fine.

The code I'm trying is identical to the various samples I've seen on the
net, here's the fragment in question (note that the connection is working
since I can list and get files, I just can't send them):

    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 + " --> " +
    ftp.storeFile(fileName, localStream);


Larry V. Streepy
Vice President and CIO
Flagship Healthcare Management, Inc.
432 Park Avenue South, 13th Floor, New York, NY 10016
(O) 212-340-9160    (F) 212-340-9101

To unsubscribe, e-mail: commons-user-unsubscribe@jaka...
For additional commands, e-mail: commons-user-help@jaka...

To unsubscribe, e-mail: commons-user-unsubscribe@jaka...
For additional commands, e-mail: commons-user-help@jaka...

This message was sent on behalf of at

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message