I'm using the fileDownload component from primefaces, but i can only download files inside the project, I would like to know if it's possible to download a file colocated outside the project, i have this code
public OrdenFiscalizacionBO() {
InputStream stream = this.getClass().getResourceAsStream("djangobook.pdf");
this.file = new DefaultStreamedContent(stream, "application/pdf", "djangobook.pdf")
}
the xd.pdf file is inside a package, but it if put this
InputStream stream = this.getClass().getResourceAsStream("C:\\Users\\3dgar\\Desktop\\djangobook.pdf")
then i got a null point exception
how to download a file outside the project usingfiledownload
-
- Information
-
Who is online
Users browsing this forum: No registered users and 39 guests