File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Sockets and Internet Protocols and the fly likes transfer files between 2 pc's Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Sockets and Internet Protocols
Bookmark "transfer files between 2 pc Watch "transfer files between 2 pc New topic

transfer files between 2 pc's

apaladugu pal

Joined: Jun 29, 2006
Posts: 2
I have an application where the user can select a computer on the LAN
and when user selects transfer a set of files should be transferred from my computer to the selected computer.I have to do this using sockets .can some one please give me some idea on how to start this.

I was thinking of writing a server socket which will be installed along with another software on all the machines in the LAN.When i run the application on my machine and select transfer how can i make the server socket program to start on the remote computer?
Stan James
(instanceof Sidekick)
Ranch Hand

Joined: Jan 29, 2003
Posts: 8791
Hi, welcome to the ranch!

I'd say it's in the definition of a server that it has to be running before it can accept any requests, so you can't send it a request to start. I Googled for "java windows service" and found this article. You might be able to make your file receiver server start up automatically this way.

The server needs to open a ServerSocket and wait for incoming connections. If you're not comfortable with this bit, work through Sun's All About Sockets tutorial.

Did that match your question? If you have more specific problems, I encourage you to post smallish bits of almost-working code and we can try to help out.

A good question is never answered. It is not a bolt to be tightened into place but a seed to be planted and to bear more seed toward the hope of greening the landscape of the idea. John Ciardi
I agree. Here's the link:
subject: transfer files between 2 pc's
It's not a secret anymore!