文件从 jsp 页面上传到 SFTP 服务器
file upload to SFTP server from a jsp page
我有一个包含上传文件按钮的网页。我的要求是,当用户选择要上传的文件并单击提交时,文件应该传输到 SFTP 服务器。我的问题是,我是否需要在客户机上安装 SSH 客户端才能实现此目的?
我想先将它作为临时文件上传到我的 http 服务器,然后再从那里上传到 SFTP 服务器,但是首先 SFTP 的目的是什么,因为文件将以未加密的形式传输到服务器。
JSP是服务器端技术。如果要涉及 JSP,则代码必须 运行 在服务器上。
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
这就是你必须要做的。
无法直接从网页中的客户端代码与 SFTP 协议进行交互。
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.
要保护浏览器和 HTTP 服务器之间的通信,请使用 HTTPS 而不是普通 HTTP。
我有一个包含上传文件按钮的网页。我的要求是,当用户选择要上传的文件并单击提交时,文件应该传输到 SFTP 服务器。我的问题是,我是否需要在客户机上安装 SSH 客户端才能实现此目的? 我想先将它作为临时文件上传到我的 http 服务器,然后再从那里上传到 SFTP 服务器,但是首先 SFTP 的目的是什么,因为文件将以未加密的形式传输到服务器。
JSP是服务器端技术。如果要涉及 JSP,则代码必须 运行 在服务器上。
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
这就是你必须要做的。
无法直接从网页中的客户端代码与 SFTP 协议进行交互。
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.
要保护浏览器和 HTTP 服务器之间的通信,请使用 HTTPS 而不是普通 HTTP。