Provide a "download button", and let the user save the generated file to the local disk ?
Most users would just not use a browser which let any page on the web mess around with their hard discs. Imagine what might happen if the site "created" c:\windows\system.dat or /etc/password.