you cannot write a file on client's machine, otherwise there would be major security issue. Any web page that u browse is opened under strict security.
Anyways if you want to do that read Java Web Start stuff. When u open a site having JWS it gives you a security popup, if u accept it then it will give some permissions to itself and then you can do whatever you want on clients mahine.
But please note JWS is not a HTML page rather it's a downloaded java code though user gets an impression that he is on web.