download pdf from server through p:fileDownload

UI Components for JSF
Post Reply
casaniva
Posts: 7
Joined: 12 Nov 2010, 23:07

05 Feb 2011, 21:19

Hello,

I have generated some reports in PDF format, that is stored on my server (c:\reports)
How I can use the p:fileDownload in order to make the PDF available for download to the users?

I checked out the showcase :


<p:fileDownload value="org.primefaces.model.DefaultStreamedContent@44ffa0" />

public FileDownloadController() {
InputStream stream = this.getClass().getResourceAsStream("primefaces.pdf");
file = new DefaultStreamedContent(stream, "application/pdf", "downloaded_primefaces.pdf");
}

Where i have to set the location of my pdf on server?

casaniva
Posts: 7
Joined: 12 Nov 2010, 23:07

07 Feb 2011, 00:49

Any help, please?

Post Reply

Return to “PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 40 guests