• Post Reply Bookmark Topic Watch Topic
  • New Topic

JSF inputFileUpload Validation

 
Vikas
Ranch Hand
Posts: 63
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I have some JSF starter questions. I am trying to upload files with JSF but when my inputFileUpload is empty it returns 0 bytes instead of showing some specific message like "No file location specified" thougthh I have set required="true" as below:

<t:inputFileUpload id="fileUpload"
accept="*.txt"
value="#{myBean.upFile}"
storage="file"
required="true"
size="50"/>
<h:commandButton value="Upload"
actionListener="#{myBean.upload}"/>

also, it shows the file name which was uploaded previousley with following tag:

<hutputText
value="#{myBean.uploadedFilename} | #{myBean.fileSize}" rendered="#{myBean.haveUploadedFile}" />

Could you please assist me in this regardds?

Thanks in advance.

Vikanglo
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"Vikanglo",
Please check your private messages regarding an important administrative matter.
-Ben
 
Vikas
Ranch Hand
Posts: 63
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for update Ben!!
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Vikas:
Thanks for update Ben!!


Please check your private messages, again.

-Ben
[ June 25, 2008: Message edited by: Ben Souther ]
 
Vikas
Ranch Hand
Posts: 63
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you again!!
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!