This can be done using any of the following: (there's probably plenty more possibilities)
- Mount the filesystem to your webserver
- FTP or SFTP to the remote box
- telnet / ssh to the remote box
- Use rsync to obtain the file listing
- Create your own protocol with daemon & client ;-)
I'd start exploring what rsync has to offer.