FileDownload

FileDownload is used to stream binary contents like files stored in database to the client. FileDownload is used by attaching it to any JSF command component like button or a link. Additionally presentation of download can be configured with the contentDisposition attribute that takes either "attachment" or "inline" as a value.

Documentation
Status
<script type="text/javascript">
    //<![CDATA[
function start() {
    PF('statusDialog').show();
}

function stop() {
    PF('statusDialog').hide();
}
    //]]>
</script>    


<p:dialog modal="true" widgetVar="statusDialog" header="Status" draggable="false" closable="false" resizable="false">
    <p:graphicImage name="/demo/images/ajaxloadingbar.gif" />
</p:dialog>
<h:form>   
    <p:commandButton value="Download" ajax="false" onclick="PrimeFaces.monitorDownload(start, stop);" icon="pi pi-arrow-down">
        <p:fileDownload value="#{fileDownloadView.file}" />
    </p:commandButton>      
</h:form>

FREE THEMES

Built-in component themes created by the PrimeFaces Theme Designer.

nova-light Nova-Light
nova-dark Nova-Dark
nova-colored Nova-Colored
luna-blue Luna-Blue
luna-amber Luna-Amber
luna-green Luna-Green
luna-pink Luna-Pink
omega Omega

PREMIUM TEMPLATES

Create awesome applications in no time using the premium templates and impress your users.