How To Create Optional "file" Validation Rule?


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? ?

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'),