[jboss-user] [JBoss Portal] - adding the upload file option in Identity portal

rashmi_ceru1 do-not-reply at jboss.com
Wed Aug 19 05:36:21 EDT 2009


Hi All , 
            I am using jboss AS 4.2+portal 2.7  . i am want to add the upload file option in the registration page . i am using the identity portal for registration page . i have added the bellow code . but when submit the form , form is not getting submited . if i use in the form tag 
enctype="multipart/form-data .
 in the portlet . xml  i am using javax.portlet.faces.GenericFacesPortlet class . 
can any one please help me on this . thanks in advance .


This is the code i have added .


I have configured the extension filter in the web.xml
<!-- Extensions Filter -->
    
        <filter-name>extensionsFilter</filter-name>
        <filter-class>org.apache.myfaces.component.html.util.ExtensionsFilter</filter-class>
        <init-param>
            <param-name>uploadMaxFileSize</param-name>
            <param-value>100m</param-value>
            Set the size limit for uploaded files.
                Format: 10 - 10 bytes
                        10k - 10 KB
                        10m - 10 MB
                        1g - 1 GB
            
        </init-param>
        <init-param>
            <param-name>uploadThresholdSize</param-name>
            <param-value>100k</param-value>
            Set the threshold size - files
                    below this limit are stored in memory, files above
                    this limit are stored on disk.

                Format: 10 - 10 bytes
                        10k - 10 KB
                        10m - 10 MB
                        1g - 1 GB
            
        </init-param>
        <!--
        <init-param>
            <param-name>uploadRepositoryPath</param-name>
            <param-value>/temp</param-value>
            Set the path where the intermediary files will be 
stored.
            
        </init-param>
        -->
    

    <filter-mapping>
        <filter-name>extensionsFilter</filter-name>
        <url-pattern>*.xhtml</url-pattern>
    </filter-mapping>
	
	
	
form is properly encoded and add the t:inputFileUpload

<h:form enctype="multipart/form-data" id="myForm" name="myForm">

<t:inputFileUpload 
  id="myUploadedFile" 
  storage="file" accept="image/*" 
  styleClass="myStyle" 
  value="#{myBackingBean.myUploadedFile}"/>

</h:form>


UploadedFile instance variable and setter/getter to backing bean

import org.apache.myfaces.custom.fileupload.UploadedFile;

public class MyBackingBean {

  private UploadedFile myUploadedFile;

  public UploadedFile getMyUploadedFile() {
    return myUploadedFile;
  }

  public void setMyUploadedFile(UploadedFile myUploadedFile) {
    this.myUploadedFile = myUploadedFile;
  }

}




View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4250332#4250332

Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4250332



More information about the jboss-user mailing list