You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by "Chen, Wei" <W....@verband.creditreform.de> on 2007/01/04 15:15:05 UTC

Question about using t:inputFileUpload and file type

Hi,

 

I use the t:inputFileUpload in my programm. One knows there is a
"bowser" button beside the file name textfiled. If one clicks this
button, a "file chose" dialog will be opened  and you can chose any file
types. 

 

Now my question: If I want only the file type of ".txt" and ".doc" to be
chosen, how can I do that?

 

Regards

 

Wei

 

 

<t:inputFileUpload id="myFileId" value="#{fileuploadBean.myFile}"

            storage="file" required="true" />


AW: Question about using t:inputFileUpload and file type

Posted by "Chen, Wei" <W....@verband.creditreform.de>.
Hi,

 

What's FormFileFilter? I couldn't find any information about it from
GOOGLE. 

 

Besides, what I mean "only the file type of .TXT"  is: The "File Chose"
dialog just show this type of files.

 

Regards

 

Wei

 

________________________________

Von: Chandru [mailto:svr.chandrasekhar@lasersoft.co.in] 
Gesendet: Freitag, 5. Januar 2007 05:14
An: MyFaces Discussion
Betreff: Re: Question about using t:inputFileUpload and file type

 

Hi,

 

   Choose for FormFileFilter from the Java File Package, Where you may
restrict them not to open..Or If you want to go with JavaScript You can
restrict bymeans of the 

 

fileName.indexOf(".txt")  != -1 

 

filename.indexOf(".doc") != -1 

 

are allowed and remaining any another case is not alllowed in the Else
Case..

 

Regards,

Chandru.

 

 

 

	----- Original Message ----- 

	From: Chen, Wei <ma...@verband.creditreform.de>  

	To: users@myfaces.apache.org 

	Sent: Thursday, January 04, 2007 7:45 PM

	Subject: Question about using t:inputFileUpload and file type

	 

	Hi,

	 

	I use the t:inputFileUpload in my programm. One knows there is a
"bowser" button beside the file name textfiled. If one clicks this
button, a "file chose" dialog will be opened  and you can chose any file
types. 

	 

	Now my question: If I want only the file type of ".txt" and
".doc" to be chosen, how can I do that?

	 

	Regards

	 

	Wei

	 

	 

	<t:inputFileUpload id="myFileId"
value="#{fileuploadBean.myFile}"

	            storage="file" required="true" />


Re: Question about using t:inputFileUpload and file type

Posted by Chandru <sv...@lasersoft.co.in>.
Hi,

   Choose for FormFileFilter from the Java File Package, Where you may restrict them not to open..Or If you want to go with JavaScript You can restrict bymeans of the 

fileName.indexOf(".txt")  != -1 

filename.indexOf(".doc") != -1 

are allowed and remaining any another case is not alllowed in the Else Case..

Regards,
Chandru.



  ----- Original Message ----- 
  From: Chen, Wei 
  To: users@myfaces.apache.org 
  Sent: Thursday, January 04, 2007 7:45 PM
  Subject: Question about using t:inputFileUpload and file type


  Hi,

   

  I use the t:inputFileUpload in my programm. One knows there is a "bowser" button beside the file name textfiled. If one clicks this button, a "file chose" dialog will be opened  and you can chose any file types. 

   

  Now my question: If I want only the file type of ".txt" and ".doc" to be chosen, how can I do that?

   

  Regards

   

  Wei

   

   

  <t:inputFileUpload id="myFileId" value="#{fileuploadBean.myFile}"

              storage="file" required="true" />