0% found this document useful (0 votes)
102 views1 page

PrimeFaces Showcase Filedwn2

This document describes how to use FileDownload to stream binary file contents stored in a database to the client. FileDownload is attached to a JSF command component like a button or link. The contentDisposition attribute can be set to "attachment" or "inline" to configure how the file is presented for download. An example shows creating a StreamedContent object with the file name, content type, and stream to the resource and returning it to be downloaded.

Uploaded by

jbsysatm
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
102 views1 page

PrimeFaces Showcase Filedwn2

This document describes how to use FileDownload to stream binary file contents stored in a database to the client. FileDownload is attached to a JSF command component like a button or link. The contentDisposition attribute can be set to "attachment" or "inline" to configure how the file is presented for download. An example shows creating a StreamedContent object with the file name, content type, and stream to the resource and returning it to be downloaded.

Uploaded by

jbsysatm
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

Get Started Themes Templates Resources v12.0.

0-SNAPSHOT

FileDownload
Search by name...
 SERVER API
DragDrop

Chunked 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.
Tooltips

Download

 Download  Ajax Download

DRAGDROP 
Draggable

DataView
download.xhtml FileDownloadView.java
DataTable

Custom
1 @Named
2 @RequestScoped
CLIENT SIDE VALIDATION 3 public class FileDownloadView {
4
Basic 5 private StreamedContent file;
Bean 6
7 public FileDownloadView() {
Custom 8 file = DefaultStreamedContent.builder()
9 .name("downloaded_boromir.jpg")
Event
10 .contentType("image/jpg")
11 .stream(() -> FacesContext.getCurrentInstance().getExternalContext().getResourceAsStream("/resources/demo/images/boromir.jpg"))
DIALOG FRAMEWORK 12 .build();
13 }
Basic 14
15 public StreamedContent getFile() {
Data 16 return file;
17 }
18 }

PrimeFaces 12.0.0 by PrimeTek   

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy