1 2 Previous Next 15 Replies Latest reply on Jun 18, 2009 10:58 AM by bharathg

    Progressbar in fileupload

      Hello,

      I am using Richfaces 3.3.1 GA under Glassfish v2.
      I am using the same example as provided in the demo for the fileupload component. I get to have everything working, apart from the following two things.
      1. Progressbar does not move.
      2. Allowflash = true returns a transfer error and not file is uploaded.

      Has anyone experienced a similar kind of problem or does any one know a solution?

      -- BG

        • 1. Re: Progressbar in fileupload
          nbelaevski

          Hi BG,

          Can you please post page code?

          • 2. Re: Progressbar in fileupload

            Hi nbelaevski,

            Heres my page code.. I have used the same bean as provided in the demo wihtout any changes..

            <%@ page contentType="text/html"%>
            <%@ page pageEncoding="UTF-8"%>
            <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
            
            <%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
            <%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
            <%@ taglib uri="http://richfaces.org/rich" prefix="rich"%>
            <%@ taglib uri="http://richfaces.org/a4j" prefix="a4j"%>
            
            <html>
            <f:view>
            
             <head>
             <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
             <title><h:outputText
             value="File upload/> </title>
             </head>
            
             <body marginwidth='0' marginheight='0' leftmargin='0' topmargin='0'>
            
             <div class="bodywrapper">
            
            
            
             <!-- The main content of the page -->
             <div class="mainContent">
            
             <h:form>
             <h:panelGrid columns="2" columnClasses="top,top">
             <rich:fileUpload fileUploadListener="#{fileUploadBean.listener}"
             maxFilesQuantity="#{fileUploadBean.uploadsAvailable}"
             id="upload"
             immediateUpload="#{fileUploadBean.autoUpload}"
             acceptedTypes="jpg, gif, png, bmp" allowFlash="#{fileUploadBean.useFlash}">
             <a4j:support event="onuploadcomplete" reRender="info" />
             </rich:fileUpload>
             <h:panelGroup id="info">
             <rich:panel bodyClass="info">
             <f:facet name="header">
             <h:outputText value="Uploaded Files Info" />
             </f:facet>
             <h:outputText value="No files currently uploaded"
             rendered="#{fileUploadBean.size==0}" />
             <rich:dataGrid columns="1" value="#{fileUploadBean.files}"
             var="file" rowKeyVar="row">
             <rich:panel bodyClass="rich-laguna-panel-no-header">
             <h:panelGrid columns="2">
             <a4j:mediaOutput element="img" mimeType="#{file.mime}"
             createContent="#{fileUploadBean.paint}" value="#{row}"
             style="width:100px; height:100px;" cacheable="false">
             <f:param value="#{fileUploadBean.timeStamp}" name="time"/>
             </a4j:mediaOutput>
             <h:panelGrid columns="2">
             <h:outputText value="File Name:" />
             <h:outputText value="#{file.name}" />
             <h:outputText value="File Length(bytes):" />
             <h:outputText value="#{file.length}" />
             </h:panelGrid>
             </h:panelGrid>
             </rich:panel>
             </rich:dataGrid>
             </rich:panel>
             <rich:spacer height="3"/>
             <br />
             <a4j:commandButton action="#{fileUploadBean.clearUploadData}"
             reRender="info, upload" value="Clear Uploaded Data"
             rendered="#{fileUploadBean.size>0}" />
             </h:panelGroup>
             </h:panelGrid>
             </h:form>
            
             </div>
             </div>
            
             </body>
             </f:view>
            </html>


            -- BG

            • 3. Re: Progressbar in fileupload

              Hello,

              could anyone help me out on this issue? Do I have to include any other libraries other than the 3 richfaces jar files for the fileupload progressbar to work?

              Regards,
              BG

              • 4. Re: Progressbar in fileupload
                ilya_shaikovsky

                the code seems ok.. If there are any exceptions in server log?

                forwarded to QA to check under your environment

                • 5. Re: Progressbar in fileupload

                  No. There are no exceptions generated.

                  • 6. Re: Progressbar in fileupload
                    adubovsky

                    Hello,

                    Unfortunately I have not reproduced your problem.
                    Could you please provide us a simple example - war file or eclipse project.
                    Send it to me by email or share on any file sharing service, e.g. sendspace.com

                    Thanks.

                    • 7. Re: Progressbar in fileupload

                      Hello,

                      I have uploaded the sample project to,

                      http://www.sendspace.com/file/ipo31v

                      It is a netbeans project.

                      Regards,
                      Bharath

                      • 8. Re: Progressbar in fileupload
                        adubovsky

                        Strangely, but problem is still not reproducible for me even with provided project:

                        - for allowFlash=false progress bar moves (may be it is not visible on little files because motion is not smoothly)

                        - for allowFlash=true no transfer errors occur. Do you use HTTPS protocol? If so, issue already exists - https://jira.jboss.org/jira/browse/RF-5624

                        • 9. Re: Progressbar in fileupload

                          Hello,

                          You are right. The allowFlash doesnt work on HTTPS protocol. The progressbar works now!! We had another filter in our application which somehow seemed to block the progress data. Now that we have re-arranged the filter chain, it works perfectly.

                          I have another question, how can I clear the temp files once the upload is finished (clearTempFiles option is true)?

                          Is the memory cleared when the clearTempFiles option is false, once the upload is finished?

                          Regards,
                          Bharath

                          • 10. Re: Progressbar in fileupload
                            nbelaevski

                            Hi Bharath,

                            Delete files using standard method.

                            Yes, memory is cleared.

                            • 11. Re: Progressbar in fileupload
                              nimo22

                              I cannot find a clearTempFiles-Property in rich:fileUpload RF 3.3.1.

                              Does it exist?

                              I have used the file.delete()-Method.

                              Where can I set the clearTempFiles-Property?

                              • 12. Re: Progressbar in fileupload
                                nimo22

                                Should I set "clearTempFiles"-Property in web.xml?

                                <init-param>
                                 <param-name>clearTempFiles</param-name>
                                 <param-value>true</param-value>
                                 </init-param>


                                or should I delete the temp-file using file.delete():

                                public void fileUpload(UploadEvent event) throws Exception{
                                
                                 ...
                                
                                event.getUploadItem().getFile().delete();
                                }


                                where lies the difference?

                                • 13. Re: Progressbar in fileupload
                                  nbelaevski

                                  I guess, the question was about createTempFiles property, not clearTempFiles.

                                  • 14. Re: Progressbar in fileupload
                                    wiberto

                                    @bharathg Can you explain what you did in terms of changing the order of the filter chain?

                                    I have a similar situation with the progress bar and I would like to see if your solution would apply to me.

                                    1 2 Previous Next