I'm using JSCH APIsto upload files to a remote SFTP server. Till now I was running Tomcat on my local system and testing the code so everything was working fine. I could upload the files from the local system to the Remote SFTP location.
Now that the code was deployed to the testing environments, I started getting the following exception:
java.io.FileNotFoundException: C:\Documents and Settings\User001\Desktop\Testing.txt (No such file or directory)
On printing the canonical path of the file, I found that the filename string that I was passing to the code, was getting the Server's Tomcat Bin directory appended to it!! So the file not found error.
Can anybody tell me please how to make the server look into the client machine's file structure, instead of the server?
Here's the Code to upload:
I'm thinking whatever the cause is, it will make my "Download Attachment" method to fail too, as it will download to the server instead of the client machine.
Note: This code works fine on localhost. So I'm assuming logic and usage of the API is fine.