That requires code that is run client-side. JavaScript lacks filesystem functions, Java applets are run in a sandbox and cannot access local filesystem. ActiveX components should have been designed that way too but seems like they can write on the local hard drive (at least, there are several exploits that write on the disk). VERY bad practice, tho. And works only on Win32 clients.
Consider using browser's "Save As..." dialog.