indiWiz.com

Subhash's Tech Log

Archive for March, 2009

Maven 2.1.0 Released

without comments

My favorite project and build management tool, Maven, has been updated. View release notes for the list of bug fixes and feature improvements.

Written by Subhash Chandran

March 26th, 2009 at 3:12 pm

Posted in build,Java,news

Tagged with , , ,

XOM 1.2.1 Released

without comments

Version 1.2.1 of XOM, the XML parsing Java library written by Elliotte Rusty Harold is released.

Written by Subhash Chandran

March 11th, 2009 at 12:40 pm

Posted in Java,news

Tagged with , ,

Forcing HTTP Download

with one comment

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:

  1. inline: This will render the content inline in the browser.
  2. 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.

Written by Subhash Chandran

March 11th, 2009 at 11:36 am

Posted in Software Dev

Tagged with