Hello,
I have a java.jar program that creates a file then uses jsch.jar to ftp
it up.
Everything works on my development machine but when the users run it off
site they get the following error on the channel.put:
Error (Sftp).sendFile[Sftp]: File not found
Here is my code:
File Path = c:\Output\upload_test.csv
ChannelSftp c = null;
JSch jsch=new JSch();
session = jsch.getSession(sftp_account.getUser(),
sftp_account.getAddress(), 22);
session.setPassword(sftp_account.getPassword());
java.util.Properties config = new java.util.Properties();
config.put("StrictHostKeyChecking", "no");
session.setConfig(config);
MyUserInfo ui = new MyUserInfo();
ui.setPassword(sftp_account.getPassword());
session.setUserInfo(ui);
session.connect();
Channel channel = session.openChannel("sftp");
channel.setXForwarding(true);
channel.connect();
c = (ChannelSftp)channel;
int mode = ChannelSftp.OVERWRITE;
SftpProgressMonitor monitor=new MyProgressMonitor();
c.put(file_path, ".", monitor,mode);
catch( SftpException e )
{
String msg = e.getMessage();
MBAState.addError("Error (Sftp).sendFile[Sftp]:
" + e.getMessage());
e.printStackTrace();
}
Thank you
Kelly Williams
608-836-4000 x805
800-258-0190 x805
Marcia Brenner Associates
8017 Excelsior Dr, Suite 120
Madison, WI 53717
------------------------------------------------------------------------------
Stay on top of everything new and different, both inside and
around Java (TM) technology - register by April 22, and save
$200 on the JavaOne (SM) conference, June 2-5, 2009, San Francisco.
300 plus technical and hands-on sessions. Register today.
Use priority code J9JMT32. http://p.sf.net/sfu/p
_______________________________________________
JSch-users mailing list
JSch-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jsch-users