select file on client side, and send it as parms in a class method

How do I do something like that?

Want a button that if user clicks it get the choice to select a file, and he has selected it , the file get send to server with a class method that read out line by line like the sample in the "getting started' sample...