Hi, all!=0A=0AThe solution has been to modify the attribute BLOCKSIZE of th=
e class SftpClient. Its previous value was 65535. It works with 32768 and e=
ven they have recommended to me to lower it 1536.=0AI ignore if the size is=
a little a standard for the sftp servers, but it would be a good idea that=
was parametrizable in a future revision/distribution.=0A=0AThank for your =
help and a greeting.=0A=0A=0A----- Mensaje original ----=0ADe: Bernardo F C=
osta <bernardofcosta@...: Mari Carmen Garcia Mateos <mcgm2002=
es@...>; sshtools-users@...: jueves, 12 de=
abril, 2007 18:13:40=0AAsunto: Re: [Sshtools-users] Error uploading file=
=0A=0A=0AI've never worked with sftp on sshtools, but maybe=0Athere is a bu=
g in this area. Consider visiting this=0AURL:=0A=0Ahttp://capivara.sourcefo=
rge.net/?SSHTools=0A=0AYou may test if such offered patches can make your=
=0Aprogram work.=0A=0A--- Mari Carmen Garcia Mateos <mcgm2002es@...>=
=0Aescreveu:=0A=0A> Hi!=0A> =0A> Trying to do a sftp upload to a server I g=
ot the=0A> following error (connection and download work):=0A> =0A> INFO: T=
he remote computer disconnected: Protocol=0A> error: packet too long: 65580=
=0A> =0A> The file is 100kb and is the same file I have=0A> downloaded befo=
re from the same server.=0A> =0A> I'm using the following java code (very s=
imilar to=0A> the example in the sshtools distribution):=0A> =0A> Confi=
gurationLoader.initialize(false);=0A> =0A> BufferedReader reader =3D ne=
w BufferedReader(new=0A> InputStreamReader(System.in));=0A> System.out.=
print("Connect to host? ");=0A> String hostname =3D reader.readLine();=
=0A> =0A> // Make a client connection=0A> SshClient ssh =3D new Ssh=
Client();=0A> // Connect to the host=0A> ssh.connect(hostname);=0A>=
=0A> // Get the users name=0A> System.out.print("Username? ");=0A>=
String username =3D reader.readLine();=0A> pk.setUsername(username=
);=0A> =0A> PublicKeyAuthenticationClient pk =3D new=0A> PublicKeyAuthe=
nticationClient();=0A> // Get the private key file=0A> System.out.p=
rint("Path to private key file? ");=0A> String filename =3D reader.read=
Line();=0A> =0A> // Open up the private key file=0A> SshPrivateKeyF=
ile file =3D=0A> SshPrivateKeyFile.parse(new File(filename));=0A> // If=
the private key is passphrase protected=0A> then ask for the passphrase=0A=
> String passphrase =3D null;=0A> if (file.isPassphraseProtected())=
{=0A> System.out.print("Enter passphrase? ");=0A> passphra=
se =3D reader.readLine();=0A> }=0A> // Get the key=0A> SshPriva=
teKey key =3D=0A> file.toPrivateKey(passphrase);=0A> pk.setKey(key);=0A=
> =0A> // Try the authentication=0A> int result =3D ssh.authenticat=
e(pk);=0A> // Evaluate the result=0A> if (result =3D=3D=0A> Authent=
icationProtocolState.COMPLETE) {=0A> // The connection is authentic=
ated we can=0A> now do some real work!=0A> SftpClient sftpclient =
=3D=0A> ssh.openSftpClient();=0A> =0A> System.out.print("Fichero lo=
cal? ");=0A> String ficherolocal =3D reader.readLine();=0A> =0A> =
System.out.print("Fichero remoto? ");=0A> String ficheroremot=
o =3D reader.readLine();=0A> =0A> sftpclient.put(ficherolocal,fiche=
roremoto);=0A> =0A> sftpclient.quit();=0A> ssh.disconnect()=
;=0A> =0A> =0A> =0A>=0A_____________________________________________=
_______________________________________=0A> LLama Gratis a cualquier PC del=
Mundo. =0A> Llamadas a fijos y m=F3viles desde 1 c=E9ntimo por=0A> minuto.=
=0A> http://es.voice.yahoo.com>=0A----------------------------------------=
---------------------------------=0A> Take Surveys. Earn Cash. Influence th=
e Future of IT=0A> Join SourceForge.net's Techsay panel and you'll get=0A> =
the chance to share your=0A> opinions on IT & business topics through brief=
=0A> surveys-and earn cash=0A>=0Ahttp://www.techsay.com/default.php?page=3D=
join.php&p=3Dsourceforge&CID=3DDEVDEV>=0A__________________________________=
_____________=0A> Sshtools-users mailing list=0A> Sshtools-users@...=
ceforge.net=0A>=0Ahttps://lists.sourceforge.net/lists/listinfo/sshtools-use=
rs=0A> =0A=0A=0A__________________________________________________=0AFale c=
om seus amigos de gra=E7a com o novo Yahoo! Messenger =0Ahttp://br.messeng=
er.yahoo.com/=0A=0A=0A =0A___________________________________________=
_________________________________________=0ALLama Gratis a cualquier PC del=
Mundo. =0ALlamadas a fijos y m=F3viles desde 1 c=E9ntimo por minuto. =0Aht=
tp://es.voice.yahoo.com
|