How To Create Optional "file" Validation Rule?

hi

i want to put an optional logo picture(by upload an image) for my company registering form.

my validation rule is:




array('logo', 'file', 'types'=>'jpg, jpeg, png', 'maxSize' => 20480, 'on'=>'create'),



but it is not optional. how can i set this optional?

http://www.yiiframework.com/doc/api/1.1/CFileValidator#allowEmpty-detail ?

thanks, i looked the Class Reference previously but wonderfully i don’t see this property.

try this


array('image_name', 'file', 'allowEmpty' => TRUE,'types' => 'jpg, jpeg, gif, png','on'=>'create'),