Server needs to contact client

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
lashki
Forum Newbie
Posts: 3
Joined: Wed Feb 22, 2006 7:04 am

Server needs to contact client

Post by lashki »

On a server running apache 2.0.55 I need to make contact to a client computer. The goal is to look what kind of files are located on the clientside and compare with those on the serverside. If not equal, the missing files need to be downloaded by the server.

The question is: how can ly server make a connection with a client?
jamiel
Forum Contributor
Posts: 276
Joined: Wed Feb 22, 2006 5:17 am
Location: London, United Kingdom

Post by jamiel »

The linux rsync tool would be ideal for what you are trying to do (man rsync).

Otherwise you will need the PHP Filesystem functions : http://uk2.php.net/manual/en/ref.filesystem.php

There are tons there to read the contents of directories and upload files. Just choose a good combination.
lashki
Forum Newbie
Posts: 3
Joined: Wed Feb 22, 2006 7:04 am

Post by lashki »

The linux rsync tool is not an option since it's running on a windows pc. Should have mentioned that.

I'll take a look at the posted link. Thx.
lashki
Forum Newbie
Posts: 3
Joined: Wed Feb 22, 2006 7:04 am

Post by lashki »

jamiel wrote:The linux rsync tool would be ideal for what you are trying to do (man rsync).

Otherwise you will need the PHP Filesystem functions : http://uk2.php.net/manual/en/ref.filesystem.php

There are tons there to read the contents of directories and upload files. Just choose a good combination.
Syncen the files isn't the problem and is already programmed. The problem is to make the connection between the server and the client. Also the client shouldn't upload the missng files, the server would grab it.

I was thinking of making the connection by ip. Suppose I would know the ip-address of my client. Isn't it possible to set up a point 2 point connection?
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

A remote client is not searchable, and is a huge security risk for that client. The client would need a server running on it to service your request, thus making your server the actual client.

A local client, one on the same LAN, might be searchable provided it has the directory mappings and security set correctly.
Post Reply