0 Replies Latest reply on Jun 22, 2012 2:10 PM by murx66

    Help with download

    murx66

      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