Sync directory contents over HTTP using PHP