views:

35

answers:

2

I would like to create an Invoice in HTML instead of a PDF-file. And I would like to let the user easyli download the HTML-file via a link. How can I do this?

If I simply link to the HTML file, it is only "temporarily downloaded" and view in the users web browser. I would like the same effect as when the user download a .zip-file or similar. I think that I have seen this functionally in webmail systems.

+1  A: 

Set a content-disposition header (or remind people about the Save As option on their menus)

David Dorward
+3  A: 

You will need to set the Content-Disposition HTTP header like so:

Content-Disposition: attachment; filename="downloaded.html"

This will tell the browser to save the file instead of parsing it. How to do that depends on what you're using, in PHP you'd use the header function.

deceze