bleu
            (Zend W)
          
          
          
              
              
          1
          
         
        
          I have made my file field to have certain options like jpg, png using the below code.
$form->fileField($model,'photo',array('types'=>'jpg, gif, png'))
Is it right.
I have seen the documentation filefield
but am not sure if placing it like this is correct
,array('types'=>'jpg, gif, png')
         
        
          
        
           
           
           
         
         
            
            
          
       
      
        
          
          
            dudhi
            (Rohitduhan)
          
          
          
              
              
          3
          
         
        
          You can do the file validation in the model, Here is the link that might help.
http://www.yiiframework.com/wiki/56/reference-model-rules-validation
         
        
        
           
           
           
         
         
            
            
          
       
      
        
          
          
            aruna470
            (Aruna470)
          
          
          
              
              
          4
          
         
        
          In your model rules define like below
array('photo', 'file', 'types'=>'jpg, gif, png', 'allowEmpty'=>true),