0

I have a webpage which contains the button to upload a file. My requirement is, when user chooses the file to upload and click the submits it, the file should get transferred to an SFTP server. My question is, do I need a SSH client installed on the client machine for achieving this? I thought of uploading it to my http server as a temp file first and then to the SFTP server from there, but then what's the purpose of SFTP on the first place as the file will be transmitted to server as unencrypted.

learner420
  • 190
  • 1
  • 6
  • 21

1 Answers1

1

JSP is a server side technology. If JSP is going to be involved, then the code has to run on the server.

My question is, do I need a SSH client installed on the client machine for achieving this?

No. The server has to do the work.

I thought of uploading it to my http server as a temp file first and then to the SFTP server from there

That's how you would have to do it.

There's no way to interact with the SFTP protocols directly from client side code in a webpage.

then to the SFTP server from there, but then what's the purpose of SFTP on the first place

Good question: But you decided to use that technology, so that's up to you.

as the file will be transmitted to server as unencrypted.

To secure communications between the browser and the HTTP server, use HTTPS instead of plain HTTP.

Quentin
  • 914,110
  • 126
  • 1,211
  • 1,335
  • Thanks you for your valuable answer Quentin. I have created a new question based on your reply. This is what my primary purpose for it. https://stackoverflow.com/questions/33486754/jsp-file-upload-conversion-from-ftp-to-sftp – learner420 Nov 02 '15 at 21:03