Win a copy of The Way of the Web Tester: A Beginner's Guide to Automating Tests this week in the Testing forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Trying to upload a file through jscape sftp API in java and not able to set the default directory

deepak jaiswal
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,

I am trying to upload a file from local system to a remote system using jscape SFTP API.
As while upload i need to create a directory to store my file and if i am setting this created folder
as root folder for upload i m getting resource access denied.
Find the below code .....

try {

// create new SshParameters instance
SshParameters params = new SshParameters(ftpHostname,ftpUsername,ftpPassword);

// create new Ftp instance
Sftp ftp = new Sftp(params);

// establish secure connection
ftp.upload("D:/temp/uploads/New Text Document.txt");

// disconnect

catch(Exception e) {

At the remote machine the sftp server is configured for the default root directory as D:/FTP.
The folder is created but if trying to cal setDir("D:/FTP/SFTPUpload") as root folder getting error.

Is any one there who can provide me the solution for this.....??


Deepak Jaiswal
Noida, India
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic