简体   繁体   English

如何从我的网站/ Web应用程序连接到安全的FtP?

[英]How to connect to a secure FtP from my website/web application?

I'm working on making a website/web application that displays images every 5 or so minutes, kinda like a webcam. 我正在制作一个网站/网络应用程序,每5分钟左右显示一次图像,有点像摄像头。 The images are uploaded to an SFTP server. 图像被上传到SFTP服务器。 How can I access those from the web? 如何从网上访问这些内容? Does anyone have any recommendations for what to use as well? 有人对使用什么也有任何建议吗? Right now I'm looking at PHP but have checked out javascript and ruby as well. 现在,我正在查看PHP,但也签出了javascript和ruby。 Only the application needs to ssh to a predetermined place, not the users. 只有应用程序需要ssh到预定位置,而不是用户。

I was suggested by a friend to use rsync and setup passwordless ssh. 一个朋友建议我使用rsync和设置无密码ssh。 Anyone ever do this? 有人这样做吗? or is this a bad idea? 还是一个坏主意?

If the application is the only thing that needs to SSH then you can rule out javascript immediately. 如果应用程序是唯一需要SSH的东西,那么您可以立即排除javascript。 It's predominately a client-side language in these environments. 在这些环境中,它主要是一种客户端语言。

You may like at Net::SSH ruby library, or I'm sure there's a php equivalent. 您可能会喜欢Net :: SSH ruby​​库,或者我确定有一个等效的php。 I have used Net:SSH and it's fairly straight forward. 我使用过Net:SSH,这很简单。

您需要编写一个服务器端脚本,该脚本连接到SFTP服务器并将映像转发到客户端。

cURL具有SFTP支持。

PHP supports SFTP. PHP支持SFTP。 You need to install ssh2 extension, 您需要安装ssh2扩展名,

http://www.php.net/manual/en/book.ssh2.php http://www.php.net/manual/zh/book.ssh2.php

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM