<p:fileUpload

jQuery UI Widgets
Post Reply
anas.ijaz
Posts: 2
Joined: 01 Nov 2013, 14:01

01 Nov 2013, 14:07

having problem in file upload using primefaces...
<p:fileUpload value="#{beanController.file}" mode="simple"/>
value is not setting in file object of UploadedFile type setter in beanController...
There is no exception while uploading file but null pointer exception occur when i try to read the file object from getter
any one know the reason?

communicator
Posts: 2
Joined: 05 Nov 2013, 20:57

05 Nov 2013, 23:27

I strongly suspect you might have missed enctype on your form .

Code: Select all

<h:form  enctype="multipart/form-data"><p:fileUpload value="#{beanController.file}" mode="simple"/> </h:form>

anas.ijaz
Posts: 2
Joined: 01 Nov 2013, 14:01

06 Nov 2013, 19:49

i also tried enctype="multipart/form-data" in form tag but no effect..
There is a mysterious thing that following code is running perfect with fileUpload advance mode

public void handleFileUpload(FileUploadEvent event) {
file = event.getFile();

}
But when i use fileUpload simple mode with value = "#{beanController.file}" then file setter is not taking its value ..

jackiesalmeida
Posts: 1
Joined: 21 Nov 2013, 19:08

21 Nov 2013, 19:17

any answers? I am having the same problem

rubus
Posts: 517
Joined: 01 Oct 2010, 09:41
Location: Belgium

22 Nov 2013, 11:39

Hi All,

In the PrimeUI forum, you won't get much help about PrimeFaces questions. Use the dedicated forum.

regards
Rudy
PrimeFaces version 3.5, Tomcat 7, Mojarra 2.1.13
PrimeFaces version 4.0, Glassfish 4.0
PrimeFaces version 5.0, WLS 12.1.2
If you haven't read the forum rules read them now : viewtopic.php?f=3&t=1194

Chasy Adler
Posts: 3
Joined: 10 Dec 2015, 10:39

18 May 2017, 15:16

Hi,

I can't find any answer for this exact problem and I tried all the solutions that was related to p:fileUpload.
Can you help me?

Thanks!

Post Reply
  • Information
  • Who is online

    Users browsing this forum: No registered users and 1 guest