How can I get directory information?

I have a client/server program and I want the server to be able to browse the client's file system, and eventualy transfer files.

But how can this be done?