I have hosted my web site on one server (server 1)and my media files are stored on other server (server 2). Now server 2 has sftp login system. Server2 is the media server.
When the user enter his username on my web page on server1 , I want to list all the files from server2 on to this web page. So how can I write a script that would allow me to login to server2 which has sftp and get the list of the files.
All files are stored in following format
GourpID - UserId -media<computer generated random number).flv
If we cannot do it with Php then what would be the best way to do it.