while validation of file type it is done in the model by array(‘attribute’,‘file’,‘types’=>‘jpg,gif,png’),

but in the form can we immediately show error on selecting the file.for type and size.

Yes it is possible. You can check file type and size using Javascript, before the image is sent to server.

Check this post: