Data AccessCore JavaApp FrameworksViewTestingBuildingDeploymentDev ToolsSecurityOpinions

Thursday, September 24, 2009

How to Post a SaveAs Dialog

To prompt a 'Save As' dialog box when downloading a file, set the Content-Disposition to 'attachment' in the HTTP header.

Read RFC 2183

You can also pre-set the saved filename by setting the filename parameter as well.

Be sure to set the appropriate MIME type or content type as well.

Below is a code example of how this would be achieved in a java servlet before committing the response.

response.setContentType( "application/pdf" );
response.setHeader("Content-disposition","attachment; filename=" + "Example.pdf" );

Hope this helps, if it does, help me out by clicking on one of my sponsors.

4 comments:

  1. Regardless of to what extent you take to pay it back, it will never cost you more than $10,000. The rebate rate offered relies upon various things, incorporating time in business, FICO assessment, process history, and so on. Cash Advances San diego

    ReplyDelete
  2. England in teddy community is a special place because that is wherein the primary museum popped up.Osos de peluche gigante

    ReplyDelete