• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

File Upload Error - Using JSCH/SFTP

 
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

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.
Thanks,
Dibyendu
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic