<rdf:RDF
    xmlns:s='http://snipsnap.org/rdf/snip-schema#'
    xmlns:rdf='http://www.w3.org/1999/02/22-rdf-syntax-ns#'
    xml:base='http://wiki.marandcustomsolutions.com/rdf'>
    <s:Snip rdf:about='http://wiki.marandcustomsolutions.com/rdf#Development/HTTP+Header'
         s:cUser='mpecher'
         s:oUser=''
         s:mUser='mpecher'>
        <s:name>Development/HTTP Header</s:name>
        <s:content>1 Prompt for download of a file&#xD;&#xA;To automatically have the browser prompt to download a file, the contentType needs to be set in the HTTP Header:\\&#xD;&#xA;{code}&#xD;&#xA;response.setContentType(application/csv);&#xD;&#xA;{code}&#xD;&#xA;(csv used an an example here)\\&#xD;&#xA;__Binary/other files__\\&#xD;&#xA;{code}&#xD;&#xA;response.setContentType(&quot;application/octet-stream&quot;);&#xD;&#xA;{code}&#xD;&#xA;May also want to set the length of the file (if known)&#xD;&#xA;{code}&#xD;&#xA;response.setContentLength((int) f.length());&#xD;&#xA;{code}&#xD;&#xA; Setting the filename for a Download &#xD;&#xA;Setting the filename of a file that is downloaded is achieved by setting the following in the HTTP Header:\\&#xD;&#xA;{code}&#xD;&#xA;response.setHeader(&quot;Content-Disposition&quot;, &quot;attachment; filename=TheFileName.txt&quot;);&#xD;&#xA;{code}&#xD;&#xA;&#xD;&#xA;__Internet Explorer download issues__&#xD;&#xA;Internet Explorer has a bug when downloading files through SSL. In this case for IE/Windows set additional:&#xD;&#xA;{code}&#xD;&#xA;response.setHeader(&quot;Cache-Control&quot;, &quot;must-revalidate&quot;);&#xD;&#xA;response.setHeader(&quot;Pragma&quot;, &quot;public&quot;);&#xD;&#xA;{code}</s:content>
        <s:mTime>2006-01-03 12:35:26.0</s:mTime>
        <s:cTime>2005-08-23 12:27:55.0</s:cTime>
        <s:comments
             rdf:type='http://www.w3.org/1999/02/22-rdf-syntax-ns#Bag'/>
        <s:snipLinks>
            <rdf:Bag>
                <rdf:li rdf:resource='#snipsnap-index'/>
                <rdf:li rdf:resource='#Development'/>
                <rdf:li rdf:resource='#snipsnap-search'/>
                <rdf:li rdf:resource='#mpecher'/>
                <rdf:li>
                    <s:Snip rdf:about='http://wiki.marandcustomsolutions.com/rdf#Development/HTTP+Header'>
                        <s:attachments
                             rdf:type='http://www.w3.org/1999/02/22-rdf-syntax-ns#Bag'/>
                    </s:Snip>
                </rdf:li>
                <rdf:li rdf:resource='http://wiki.marandcustomsolutions.com/rdf#Development/HTTP%2bHeader'/>
                <rdf:li rdf:resource='http://wiki.marandcustomsolutions.com/rdf#Development/HTTP%2bHeader/'/>
                <rdf:li rdf:resource='http://wiki.marandcustomsolutions.com/rdf#snipsnap-index/Security'/>
            </rdf:Bag>
        </s:snipLinks>
    </s:Snip>
</rdf:RDF>

