SFTP Custom code for file downloads

Tony it9265@yahoo.com
Thu, 13 Feb 2003 07:19:33 -0800 (PST)


I have used selected classes from the MindTerm source
code to build my own client to perform SFTP
transactions.

Everything works when connecting to an SSH.COM WINDOWS
based server i.e. I can perform uploads and downloads.
 The server has the default out-of-the-box settings.

But... when I connect to an SSH.COM UNIX based server,
upload works fine, but I am not able to download any
file i.e. 
- I am able to get a connection
- I am able to browse the directory
- I am able to get the file handle
- but... when I try to download the file (readFully) I
get an error 4... (?!?)

Any help will be appreciated.

Following is the test code that I am using for
downloads:

public void tranferTestFile() throws Exception {
	if (client2 == null)
		client2 = new SSH2SFTPClient(connection, false);
	String fName = "/test/mytestfile.txt";
	FileOutputStream fout = new
FileOutputStream("c:\\mytest.txt");
	try {
SSH2SFTP.FileHandle fh = 
client2.open(
fName, 
SSH2SFTP.SSH_FXF_READ, 
new SSH2SFTP.FileAttributes());
		client2.readFully(fh, fout);
	} finally {
		// we'll do something			
	}
}


__________________________________________________
Do you Yahoo!?
Yahoo! Shopping - Send Flowers for Valentine's Day
http://shopping.yahoo.com