Bug Composant UPLOAD

Post Reply
dakisoft
Posts: 2
Joined: 17 Nov 2015, 13:02

10 Aug 2018, 11:14

Hi everyone,

I have a probleme,
when we have integrate template paradise ,we have been obliged to upgrade from primefaces 6.1 to 6.2.... we followed all the instructions in documentation but the FileUpload stop working .... we tried all the solutions propose in your documentaion but still not working

web.xml

Code: Select all

<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"
	xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
    http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"
	id="WebApp_ID" version="3.0" metadata-complete="true">


	<display-name>APP_NAME</display-name>


	<!-- CONFIGURATION FILES both Bean definition and security 
	<context-param>
		<param-name>contextConfigLocation</param-name>
		<param-value>
                /WEB-INF/classes/CONFIGURATION/SPRING/BEANDEFINITION/jsfspring-sec-bean-config.xml
                /WEB-INF/classes/CONFIGURATION/SPRING/SECURITY/jsfspring-sec-security-config.xml
        </param-value>
	</context-param>
 	CONFIGURATION FILES END HERE -->


	<!-- Integrate primefaces theme -->
	<context-param>
		<param-name>primefaces.THEME</param-name>
		<param-value>primefaces-paradise-purple</param-value>
	</context-param>
	 <context-param>
        <param-name>primefaces.FONT_AWESOME</param-name>
        <param-value>true</param-value>
    </context-param>
    <context-param>
        <param-name>javax.faces.FACELETS_LIBRARIES</param-name>
        <param-value>/WEB-INF/primefaces-paradise.taglib.xml</param-value>
    </context-param>
	
	
	 <!-- filtr pour auto upload primefaces -->
	 <filter>
	       <filter-name>primeFacesFileUploadFilter</filter-name>
	       <filter-class>org.primefaces.webapp.filter.FileUploadFilter</filter-class>
	       <init-param>
	       		<param-name>thresholdSize</param-name>
	       		<param-value>51200</param-value>
	       </init-param>
	       <init-param>
	       		<param-name>uploadDirectory</param-name>
	       		<param-value>C:\Users\Admin\</param-value>
	       </init-param>
	</filter>
	<filter-mapping>
	   <filter-name>primeFacesFileUploadFilter</filter-name>
	   <servlet-name>Faces Servlet</servlet-name>
	   <dispatcher>FORWARD</dispatcher>
	   	<dispatcher>REQUEST</dispatcher>
		<dispatcher>INCLUDE</dispatcher>
		<dispatcher>ERROR</dispatcher>
	</filter-mapping>
	 <context-param>
     <param-name>primefaces.UPLOADER</param-name>
    	<param-value>auto|native|commons</param-value>
 	 </context-param>


	<!-- PROJECT STAGE START FOR DEVELOPEMENT MARK IT AS DEVELOPMENT, FOR TESTING, UAT, PRODUCTION REMOVE THIS -->
	<context-param>
		<param-name>javax.faces.PROJECT_STAGE</param-name>
		<param-value>Production</param-value>
	</context-param>
	<!-- PROJECT STAGE END -->


	<!-- Enable JSF Servlet -->
	<servlet>
		<servlet-name>Faces Servlet</servlet-name>
		<servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
		<load-on-startup>1</load-on-startup>
	</servlet>

	<servlet-mapping>
		<servlet-name>Faces Servlet</servlet-name>
		<url-pattern>*.jsf</url-pattern>
	</servlet-mapping>
	
	<servlet-mapping>
		<servlet-name>Faces Servlet</servlet-name>
		<url-pattern>*.xhtml</url-pattern>
	</servlet-mapping>
	<!-- Enable JSF Server End -->
	
	
	  <!-- Integrate JSF and Spring -->
    <listener>
        <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
    </listener>
    <!-- Integrate JSF and Spring End-->
    
    
    
    <!-- Enable Spring Filter, Spring Security works on the concept of Filters -->
    <filter>
        <filter-name>springSecurityFilterChain</filter-name>
        <filter-class>
            org.springframework.web.filter.DelegatingFilterProxy
        </filter-class>
    </filter>
     
    <filter-mapping>
        <filter-name>springSecurityFilterChain</filter-name>
        <url-pattern>/*</url-pattern>
		<dispatcher>FORWARD</dispatcher>
		<dispatcher>REQUEST</dispatcher>
		<dispatcher>INCLUDE</dispatcher>
		<dispatcher>ERROR</dispatcher>
    </filter-mapping>
    <!-- Enable Spring Filter End -->
    
    
    
    <!-- filter resources -->
	
	<context-param>
        <param-name>RESOURCES_REPOSITORY</param-name>
        <param-value>C:\Users\Admin\</param-value>
    </context-param>

  	<context-param>
        <param-name>primefaces.PUBLIC_CAPTCHA_KEY</param-name>
        <param-value>6LeN6CcTAAAAAB2CxsP8Iwsk6V-IPBCGHjOwlj8E</param-value>
    </context-param>

    <context-param>
        <param-name>primefaces.PRIVATE_CAPTCHA_KEY</param-name>
        <param-value>6LeN6CcTAAAAANQ8vrgzFM6gsYOOnSqtyU0S9SNM</param-value>
    </context-param>
    
	<filter>
		<filter-name>FilterResources</filter-name>
		<filter-class>com.app.filter.FilterResources</filter-class>
	</filter>
	

	<filter-mapping>
		<filter-name>FilterResources</filter-name>
		<url-pattern>/filterResources/*</url-pattern>
	</filter-mapping>

	
	<!-- Filter Resources End-->

	<!-- Configure Rewrite Url -->
	
	<listener>
		<listener-class>org.ocpsoft.rewrite.servlet.impl.RewriteServletRequestListener</listener-class>
	</listener>

	<listener>
		<listener-class>org.ocpsoft.rewrite.servlet.impl.RewriteServletContextListener</listener-class>
	</listener>
  
	 <filter>
		<filter-name>OCPsoft Rewrite Filter</filter-name>
		<filter-class>org.ocpsoft.rewrite.servlet.RewriteFilter</filter-class>
	 <!--  	<async-supported>true</async-supported>-->
	</filter>
	
	
	<filter-mapping>
		<filter-name>OCPsoft Rewrite Filter</filter-name>
		<url-pattern>/*</url-pattern>
		<dispatcher>FORWARD</dispatcher>
		<dispatcher>REQUEST</dispatcher>
		<dispatcher>INCLUDE</dispatcher>
		<!-- <dispatcher>ASYNC</dispatcher>
		<dispatcher>ERROR</dispatcher> -->
	</filter-mapping>
	<!-- Configure Rewrite Url  End-->
	

	<context-param>
		<param-name>javax.faces.INTERPRET_EMPTY_STRING_SUBMITTED_VALUES_AS_NULL</param-name>
		<param-value>true</param-value>
	</context-param>
	
	<context-param>
		<param-name>javax.faces.DATETIMECONVERTER_DEFAULT_TIMEZONE_IS_SYSTEM_TIMEZONE</param-name>
		<param-value>true</param-value>
	</context-param>
	
	<context-param>
		<param-name>com.sun.faces.expressionFactory</param-name>
		<param-value>com.sun.el.ExpressionFactoryImpl</param-value>
	</context-param>
	
   
    
    <!-- Welcome File  -->
    <welcome-file-list>
        <welcome-file>/pages/index/index.jsp</welcome-file>
    </welcome-file-list>
    <!-- Welcome File End-->
    
    <mime-mapping>
        <extension>ttf</extension>
        <mime-type>application/font-sfnt</mime-type>
    </mime-mapping>
    <mime-mapping>
        <extension>woff</extension>
        <mime-type>application/font-woff</mime-type>
    </mime-mapping>
    <mime-mapping>
        <extension>woff2</extension>
        <mime-type>application/font-woff2</mime-type>
    </mime-mapping>
    <mime-mapping>
        <extension>eot</extension>
        <mime-type>application/vnd.ms-fontobject</mime-type>
    </mime-mapping>
    <mime-mapping>
        <extension>eot?#iefix</extension>
        <mime-type>application/vnd.ms-fontobject</mime-type>
    </mime-mapping>
    <mime-mapping>
        <extension>svg</extension>
        <mime-type>image/svg+xml</mime-type>
    </mime-mapping>
    <mime-mapping>
        <extension>svg#exosemibold</extension>
        <mime-type>image/svg+xml</mime-type>
    </mime-mapping>
    <mime-mapping>
        <extension>svg#exobolditalic</extension>
        <mime-type>image/svg+xml</mime-type>
    </mime-mapping>
    <mime-mapping>
        <extension>svg#exomedium</extension>
        <mime-type>image/svg+xml</mime-type>
    </mime-mapping>
    <mime-mapping>
        <extension>svg#exoregular</extension>
        <mime-type>image/svg+xml</mime-type>
    </mime-mapping>
    <mime-mapping>
        <extension>svg#fontawesomeregular</extension>
        <mime-type>image/svg+xml</mime-type>
    </mime-mapping>
    
</web-app>

pom_xml

Code: Select all

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
	<modelVersion>4.0.0</modelVersion>
	<groupId>com.app</groupId>
	<artifactId>APP_NAME</artifactId>
	<packaging>war</packaging>
	<version>0.0.1-SNAPSHOT</version>
	<name>APP_NAME Maven Webapp</name>
	<url>http://maven.apache.org</url>

	<properties>

		<maven.compiler.source>1.7</maven.compiler.source>
		<maven.compiler.target>1.7</maven.compiler.target>

		<!-- Build -->
		<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
		<java.version>1.7</java.version>
		<wtp.version>2.0</wtp.version>

		<!-- Test -->
		<junit.version>4.10</junit.version>

		<!-- SPRING -->

		<spring.version>4.2.3.RELEASE</spring.version>
		<spring.security.version>4.0.3.RELEASE</spring.security.version>

		<!-- HIBERNATE -->

		<hibernate.version>4.3.11.Final</hibernate.version>

		<!-- Servlet et pages -->
		<mojarra.version>2.1.4</mojarra.version>
		<jstl.version>1.2</jstl.version>
		<servlet-api.version>2.5</servlet-api.version>

		<!-- Plugins -->
		<maven-compiler-plugin.version>2.3.2</maven-compiler-plugin.version>
		<maven-eclipse-plugin.version>2.8</maven-eclipse-plugin.version>
		<tomcat-maven-plugin.version>1.1</tomcat-maven-plugin.version>

		<!-- URL rewriting -->
		<URL-Rewriting.version>2.0.12.Final</URL-Rewriting.version>

		<!-- PrimeFaces -->
		<primefaces.version>6.2</primefaces.version>
		<primefaces-theme.version>1.0.3</primefaces-theme.version>

		<!-- OmniFaces -->
		<omniFaces.version>1.12.1</omniFaces.version>

		<!-- Joda-time -->
		<joda-time.version>2.9.2</joda-time.version>

		<!-- commons-collections -->
		<commons-collections.version>3.2.2</commons-collections.version>

		<!-- java mail -->
		<java.mail.version>1.4.7</java.mail.version>


		<!-- commns io version -->
		<commons-io.version>2.2</commons-io.version>

		<spring.batch.version>2.2.0.RELEASE</spring.batch.version>


		<!-- Google JSON -->
		<google.json.version>2.5</google.json.version>

		<commons-lang.version>2.3</commons-lang.version>

		<opencsv.version>2.3</opencsv.version>

		<jackson.version>2.3.3</jackson.version>



	</properties>



	<dependencies>
		<!-- QR -->
		<dependency>
			<groupId>com.google.zxing</groupId>
			<artifactId>core</artifactId>
			<version>3.2.1</version>
		</dependency>
		<!-- firbase -->
		<dependency>
			<groupId>com.google.firebase</groupId>
			<artifactId>firebase-admin</artifactId>
			<version>5.4.0</version>
		</dependency>

		<!-- PrimeFaces core & theme -->
		<dependency>
			<groupId>org.primefaces</groupId>
			<artifactId>primefaces</artifactId>
			<version>6.2</version>
		</dependency>

		<dependency>
			<groupId>org.primefaces.themes</groupId>
			<artifactId>paradise</artifactId>
			<version>1.0.3</version>
		</dependency>


		<!-- SPRING -->
		<dependency>
			<groupId>org.springframework</groupId>
			<artifactId>spring-context</artifactId>
		</dependency>

		<!-- Spring ORM support -->
		<dependency> 
			<groupId>org.springframework</groupId>
			<artifactId>spring-orm</artifactId>
		</dependency>

		<dependency>
			<groupId>org.springframework</groupId>
			<artifactId>spring-tx</artifactId>
		</dependency>

		<dependency>
			<groupId>org.springframework.security</groupId>
			<artifactId>spring-security-web</artifactId>
			<version>${spring.security.version}</version>
		</dependency>

		<dependency>
			<groupId>org.springframework.security</groupId>
			<artifactId>spring-security-config</artifactId>
			<version>${spring.security.version}</version>
		</dependency>

		<dependency>
			<groupId>org.springframework</groupId>
			<artifactId>spring-context-support</artifactId>
		</dependency>

		<!-- JAVA MAIL -->
		<dependency>
			<groupId>javax.mail</groupId>
			<artifactId>mail</artifactId>
			<version>${java.mail.version}</version>
		</dependency>


		<!-- add by my -->
		<dependency>
			<groupId>org.glassfish.web</groupId>
			<artifactId>el-impl</artifactId>
			<version>2.2</version>
		</dependency>




		<!-- JSF -->
		<dependency>
			<groupId>com.sun.faces</groupId>
			<artifactId>jsf-api</artifactId>
			<version>2.2.12</version>
		</dependency>

		<dependency>
			<groupId>com.sun.faces</groupId>
			<artifactId>jsf-impl</artifactId>
			<version>${mojarra.version}</version>
			<scope>compile</scope>
		</dependency>
		<!-- ajoutée -->
		<!-- Hibernate -->
		<dependency>
			<groupId>org.hibernate</groupId>
			<artifactId>hibernate-entitymanager</artifactId>
			<version>${hibernate.version}</version>
		</dependency>
		<dependency>
			<groupId>org.hibernate</groupId>
			<artifactId>hibernate-core</artifactId>
			<version>${hibernate.version}</version>
		</dependency>


		<!-- Servlet 2.5 -->
		<dependency>
			<groupId>javax.servlet</groupId>
			<artifactId>servlet-api</artifactId>
			<version>3.1.0</version>
			<scope>provided</scope>
		</dependency>


		<!-- JSTL -->
		<dependency>
			<groupId>javax.servlet</groupId>
			<artifactId>jstl</artifactId>
			<version>${jstl.version}</version>
		</dependency>



		<!-- JUNIT -->
		<dependency>
			<groupId>junit</groupId>
			<artifactId>junit</artifactId>
			<version>${junit.version}</version>
			<scope>test</scope>
		</dependency>


		<!-- OCPsoft URL-Rewriting Framework -->
		<dependency>
			<groupId>org.ocpsoft.rewrite</groupId>
			<artifactId>rewrite-servlet</artifactId>
			<version>${URL-Rewriting.version}</version>
		</dependency>

		<dependency>
			<groupId>org.ocpsoft.rewrite</groupId>
			<artifactId>rewrite-integration-faces</artifactId>
			<version>${URL-Rewriting.version}</version>
		</dependency>


		<dependency>
			<groupId>mysql</groupId>
			<artifactId>mysql-connector-java</artifactId>
			<version>5.1.9</version>
		</dependency>

		<dependency>
			<groupId>org.apache.poi</groupId>
			<artifactId>poi</artifactId>
			<version>3.15-beta1</version>
		</dependency>


		<dependency>
			<groupId>org.apache.poi</groupId>
			<artifactId>poi</artifactId>
			<version>3.10-FINAL</version>
		</dependency>

		<dependency>
			<groupId>org.apache.poi</groupId>
			<artifactId>poi-ooxml</artifactId>
			<version>3.10-FINAL</version>
		</dependency>

		<dependency>
			<groupId>joda-time</groupId>
			<artifactId>joda-time</artifactId>
			<version>${joda-time.version}</version>
		</dependency>

		<dependency>
			<groupId>org.omnifaces</groupId>
			<artifactId>omnifaces</artifactId>
			<version>${omniFaces.version}</version>
		</dependency>

		<dependency>
			<groupId>commons-collections</groupId>
			<artifactId>commons-collections</artifactId>
			<version>${commons-collections.version}</version>
		</dependency>


		<!-- Spring Core -->


		<dependency>
			<groupId>org.springframework</groupId>
			<artifactId>spring-core</artifactId>
		</dependency>


		<dependency>
			<groupId>commons-io</groupId>
			<artifactId>commons-io</artifactId>
			<version>${commons-io.version}</version>
		</dependency>


		<dependency>
			<groupId>commons-fileupload</groupId>
			<artifactId>commons-fileupload</artifactId>
			<version>1.3.3</version>
		</dependency>

		<!-- Spring Batch dependencies -->

		<dependency>
			<groupId>org.springframework.batch</groupId>
			<artifactId>spring-batch-core</artifactId>
			<version>${spring.batch.version}</version>
		</dependency>


		<dependency>
			<groupId>org.springframework.batch</groupId>
			<artifactId>spring-batch-infrastructure</artifactId>
			<version>${spring.batch.version}</version>
		</dependency>

		<dependency>
			<groupId>net.sf.jasperreports</groupId>
			<artifactId>jasperreports</artifactId>
			<version>3.7.6</version>
		</dependency>

		<dependency>
			<groupId>com.google.code.gson</groupId>
			<artifactId>gson</artifactId>
			<version>${google.json.version}</version>
		</dependency>

		<dependency>
			<groupId>com.lowagie</groupId>
			<artifactId>itext</artifactId>
			<version>2.1.7</version>
		</dependency>

		<!-- commons-lang -->
		<dependency>
			<groupId>commons-lang</groupId>
			<artifactId>commons-lang</artifactId>
			<version>${commons-lang.version}</version>
		</dependency>


		<dependency>
			<groupId>net.sf.opencsv</groupId>
			<artifactId>opencsv</artifactId>
			<version>${opencsv.version}</version>
		</dependency>

		<dependency>
			<groupId>org.springframework</groupId>
			<artifactId>spring-test</artifactId>
			<scope>test</scope>
		</dependency>


		<dependency>
			<groupId>org.springframework</groupId>
			<artifactId>spring-webmvc</artifactId>
		</dependency>



		<!-- dépendances pour jackson mapper -->
		<dependency>
			<groupId>com.fasterxml.jackson.core</groupId>
			<artifactId>jackson-core</artifactId>
			<version>${jackson.version}</version>
		</dependency>

		<dependency>
			<groupId>com.fasterxml.jackson.core</groupId>
			<artifactId>jackson-databind</artifactId>
			<version>${jackson.version}</version>
		</dependency>

		<dependency>
			<groupId>com.fasterxml.jackson.core</groupId>
			<artifactId>jackson-annotations</artifactId>
			<version>${jackson.version}</version>
		</dependency>



		<!-- FIrebase Dependency config -->

		<!-- Google Cloud Platform dependencies -->
		<dependency>
			<groupId>com.google.api-client</groupId>
			<artifactId>google-api-client</artifactId>
			<version>1.22.0</version>
			<exclusions>
				<exclusion>
					<groupId>com.google.guava</groupId>
					<artifactId>guava-jdk5</artifactId>
				</exclusion>
			</exclusions>
		</dependency>
		<dependency>
			<groupId>com.google.api-client</groupId>
			<artifactId>google-api-client-gson</artifactId>
			<version>1.22.0</version>
		</dependency>
		<dependency>
			<groupId>com.google.http-client</groupId>
			<artifactId>google-http-client</artifactId>
			<version>1.22.0</version>
		</dependency>
		<dependency>
			<groupId>com.google.api</groupId>
			<artifactId>api-common</artifactId>
			<version>1.1.0</version>
		</dependency>
		<dependency>
			<groupId>com.google.auth</groupId>
			<artifactId>google-auth-library-oauth2-http</artifactId>
			<version>0.8.0</version>
		</dependency>
		<dependency>
			<groupId>com.google.cloud</groupId>
			<artifactId>google-cloud-storage</artifactId>
			<version>1.2.1</version>
		</dependency>

		<!-- Utilities -->
		<dependency>
			<groupId>com.google.guava</groupId>
			<artifactId>guava</artifactId>
			<version>20.0</version>
		</dependency>
		<dependency>
			<groupId>org.json</groupId>
			<artifactId>json</artifactId>
			<version>20160810</version>
		</dependency>
		<dependency>
			<groupId>org.slf4j</groupId>
			<artifactId>slf4j-api</artifactId>
			<version>1.7.25</version>
		</dependency>


		<dependency>
			<groupId>org.slf4j</groupId>
			<artifactId>slf4j-simple</artifactId>
			<version>1.6.4</version>
		</dependency>
		<!-- Test dependencies -->
		<dependency>
			<groupId>org.mockito</groupId>
			<artifactId>mockito-core</artifactId>
			<version>2.7.21</version>
			<scope>test</scope>
		</dependency>
		<dependency>
			<groupId>net.java.quickcheck</groupId>
			<artifactId>quickcheck</artifactId>
			<version>0.6</version>
			<scope>test</scope>
		</dependency>
		<dependency>
			<groupId>com.cedarsoftware</groupId>
			<artifactId>java-util</artifactId>
			<version>1.26.0</version>
			<scope>test</scope>
		</dependency>
		<dependency>
			<groupId>junit</groupId>
			<artifactId>junit</artifactId>
			<version>4.12</version>
			<scope>test</scope>
		</dependency>


		<!-- Fin firebase Dependency -->


	</dependencies>

	<dependencyManagement>
		<dependencies>
			<dependency>
				<groupId>org.springframework</groupId>
				<artifactId>spring-framework-bom</artifactId>
				<version>4.2.3.RELEASE</version>
				<type>pom</type>
				<scope>import</scope>
			</dependency>
		</dependencies>
	</dependencyManagement>
	
	


	<build>


		<finalName>APP_NAME</finalName>
	</build>
</project>

uploadmedia.java

Code: Select all

public void uploadMedia(FileUploadEvent e) throws IOException {
		System.out.println("plzzzzzzzzzz khdmiiiiii ");
		UploadedFile uploadedMedia = e.getFile();
		String filePath = RESOURCES_REPOSITORY;
		extension = uploadedMedia.getFileName().substring(uploadedMedia.getFileName().lastIndexOf(".") + 1);

		String[] SuportedImagenames = ImageIO.getWriterFormatNames();
		for (int i = 0; i < SuportedImagenames.length; ++i) {

			if (SuportedImagenames[i].toString().equalsIgnoreCase(extension)) {
				addMessage(FacesMessage.SEVERITY_INFO, "Image", extension);
				System.out.println(filePath);
				filePath = filePath + "/Image/";
				System.out.println(filePath);
				byte[] bytes = null;

				if (null != uploadedMedia) {

					bytes = uploadedMedia.getContents();
					Date tmpdate = new Date();
					System.out.println(new Date().getTime());
					filename = FilenameUtils.removeExtension((uploadedMedia.getFileName()));
					filename = filename + +dateUtils.getUTCTicks(tmpdate);
					BufferedOutputStream stream = new BufferedOutputStream(
							new FileOutputStream(new File(filePath + filename + "." + extension)));
					stream.write(bytes);
					stream.close();
					addMessage(FacesMessage.SEVERITY_INFO, "Image Enregistré", "");
				}
				return;
			}
		}
		if (extension.equalsIgnoreCase("mp4") || extension.equalsIgnoreCase("mkv")) {
			addMessage(FacesMessage.SEVERITY_INFO, "Video", extension);
			filePath = filePath + "/Video/";
			byte[] bytes = null;
			if (null != uploadedMedia) {
				bytes = uploadedMedia.getContents();
				Date tmpdate = new Date();
				filename = FilenameUtils.removeExtension((uploadedMedia.getFileName()));
				filename = filename + +dateUtils.getUTCTicks(tmpdate);
				BufferedOutputStream stream = new BufferedOutputStream(
						new FileOutputStream(new File(filePath + filename + "." + extension)));
				stream.write(bytes);
				stream.close(); :oops: 
				addMessage(FacesMessage.SEVERITY_INFO, "Vidéo enregistré ", filename);
			}
			return;

		} else {
			addMessage(FacesMessage.SEVERITY_ERROR, "this media is not suported", "!!");

		}

	}

composant-upload.xhtml.

Code: Select all

<p:fileUpload fileUploadListener="#{adminBean.uploadMedia}" label="#{msg.LABEL_PHOTO}" update="msgactualite"
								mode="advanced"  allowTypes="/(\.|\/)(gif|jpe?g|png)$/" process="@form"
								auto="true" >
						</p:fileUpload>

User avatar
aragorn
Posts: 3284
Joined: 29 Jun 2013, 12:38

13 Aug 2018, 09:31

Does it work when you change PF6.2 to PF6.1 on Paradise Layout? I think this is not layout issue.

Best Regards,

Post Reply

Return to “Paradise - PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 0 guests