So you are writing a web application the user views on a web browser, and you want to save the file locally on the user's hard disk? Is that correct?
If so, then no, you can't do that. This is a security feature that there is no easy way around (thank goodness). The only way around with Java would be to make a Signed
Applet that has security permissions to save to the local file system.