[jboss-dev-forums] [JBoss Web Development] - Help with download

Juan Manuel Pereyra Echeverz do-not-reply at jboss.com
Fri Jun 22 14:10:54 EDT 2012


Juan Manuel Pereyra Echeverz [https://community.jboss.org/people/murx66] created the discussion

"Help with download"

To view the discussion, visit: https://community.jboss.org/message/743761#743761

--------------------------------------------------------------
I have the following code that returns me the address of a temporary object. I need to open the browser window to select the location and name of the download.
 I am working with JSF 2.0 and Rich Faces.
 I have not found any component for downloads.

 Any idea how to make the download code?

 I thank you in advance  :) 

 Code of UploadFileBean for file creation and return of the route:

---------------------------------------------------------------------------------------------------------------------
public String download() {

        try {
            final FacesContext facesContext = FacesContext.getCurrentInstance();
            String path = guardaBlobEnFicheroTemporal(archivo);
            HttpServletResponse response = getResponse();
            response. sendRedirect(path);
            //writeOutContent(response, file, "prueba.docx");
            //System.out.println("3******************************");
            facesContext.responseComplete();


        } 
        catch (Exception e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
        return null;
    }
-------------------------------------------------------------------------------------------------------------------------

Now I need open download window from browsers.
 As could do this?

Thanks  :)
--------------------------------------------------------------

Reply to this message by going to Community
[https://community.jboss.org/message/743761#743761]

Start a new discussion in JBoss Web Development at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2112]

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/jboss-dev-forums/attachments/20120622/4535a425/attachment.html 


More information about the jboss-dev-forums mailing list