Archive for March, 2009
Maven 2.1.0 Released
My favorite project and build management tool, Maven, has been updated. View release notes for the list of bug fixes and feature improvements.
XOM 1.2.1 Released
Forcing HTTP Download
To force HTTP download of a dynamically generated content, I usually set the HTTP header Content-Type to application/octet-stream. This forces the browser to display the Save dialog box. But this has the limitation of sending the wrong content-type even when we know the correct one. Recently I discovered another HTTP header which solves this problem. This is the Content-Disposition header. This can take following two vales:
- inline: This will render the content inline in the browser.
- attachment: This will force the browser to display the Save dialog.
When generating dynamic content, it is also recommended to specify proper filename. This file name can also be specified as a parameter to Content-Disposition header. An example:
Content-Disposition: attachment;filename=document.pdf
Content-Disposition is covered in RFC 2183.