L
long990802
I write a class which inherit form sun.net.ftp.FtpClient. In this
class, there is a method named downLoadFile to download file from a ftp
server. Here is some code of this method:
byte[] content = new byte[1024];
super.cd(remotePath);
RandomAccessFile file = new RandomAccessFile(downLoadFileName, "rw");
TelnetInputStream in = super.get(remoteFile);
DataInputStream input = new DataInputStream(in);
while(input.available() > 0) {
input.read(content);
file.write(content);
}
in.close();
file.close();
When I use this method, I got a error:
sun.net.ftp.FtpProtocolException: Error reading FTP pending reply
Anybody can help me?
class, there is a method named downLoadFile to download file from a ftp
server. Here is some code of this method:
byte[] content = new byte[1024];
super.cd(remotePath);
RandomAccessFile file = new RandomAccessFile(downLoadFileName, "rw");
TelnetInputStream in = super.get(remoteFile);
DataInputStream input = new DataInputStream(in);
while(input.available() > 0) {
input.read(content);
file.write(content);
}
in.close();
file.close();
When I use this method, I got a error:
sun.net.ftp.FtpProtocolException: Error reading FTP pending reply
Anybody can help me?