-
1. Re: Progressbar in fileupload
nbelaevski Jun 5, 2009 2:39 PM (in response to bharathg)Hi BG,
Can you please post page code? -
2. Re: Progressbar in fileupload
bharathg Jun 6, 2009 7:00 AM (in response to bharathg)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
bharathg Jun 8, 2009 4:50 AM (in response to bharathg)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 Jun 8, 2009 6:11 AM (in response to bharathg)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
bharathg Jun 8, 2009 7:45 AM (in response to bharathg)No. There are no exceptions generated.
-
6. Re: Progressbar in fileupload
adubovsky Jun 8, 2009 10:07 AM (in response to bharathg)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
bharathg Jun 9, 2009 4:01 AM (in response to bharathg)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 Jun 9, 2009 8:27 AM (in response to bharathg)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
bharathg Jun 10, 2009 7:16 AM (in response to bharathg)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 Jun 10, 2009 7:46 AM (in response to bharathg)Hi Bharath,
Delete files using standard method.
Yes, memory is cleared. -
11. Re: Progressbar in fileupload
nimo22 Jun 11, 2009 10:30 AM (in response to bharathg)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 Jun 11, 2009 10:36 AM (in response to bharathg)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 Jun 11, 2009 1:28 PM (in response to bharathg)I guess, the question was about createTempFiles property, not clearTempFiles.
-
14. Re: Progressbar in fileupload
wiberto Jun 15, 2009 8:46 PM (in response to bharathg)@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.