There are lots of ways to transfer a file from a client to a server and depending on the purpose and what your working with you can probably narrow it down to what suits you best..
Are you writing both the client and server software? If you are, you can do it however you like, if not you'll have to find out what protocols the application your trying to send/get a file from uses and use that.
Obviously you'll have to send it over the network, if your writing both the client and server and what to do all the dirty work yourself you should look at Sockets. There is a tutorial on the java website. Basically all you have to do is make a TCP connection between the client and server (using Sockets). You can then either come up with your own protocol or implement a protocol meant for transfering files, like FTP.
If you just had to send one file a simple protocol could be something like this:
Client: connect to server and say "hello"
Server: respond with "hello"
Client: sends filename to be sent
Server: responds "okay filename" or maybe "no filename" if it won't accept it
Client: opens a filestream of some sort and sends the file bit by bit.
Server: after file succesfully saved says "received filename"
Client: "good quitting"
Server: "quitting"
You could make it even simpler than that, but that is the basics.
If you don't want to have to deal with that or your interfacing with an FTP server you didn't write on one end. There are some implementations your free to use in Java at this link:
Java FTP Tips
I'd take a look at that page, the java page on Sockets, and lookup some basic information on TCP (transmission control protocol) so you can figure out what is going to best suite your needs.