http://www.perlmonks.org?node_id=161040


in reply to How do i force the user to download my content?

As per RFC 2616 (HTTP/1.1), you might try setting the following headers:

Content-Disposition: attachment; filename="fname.ext" Content-Type: application/octet-stream

Note:
In practice the content-disposition only specifies a preferred filename for when you choose "Save as" from your browser-menu.

You also need to set content-type to application/octet-stream if you want the browser to "force" a "Save file as..." popup instead of it trying to display the data first.

Joost.