Image Upload Using Chtml Form

I am using CHtml form for uploading an image. This is the code


<div class="form">

    <?php echo CHtml::beginForm(); ?>

    <div class="row">

        <?php echo CHtml::activeLabel($model, 'image'); ?>

        <?php echo CHtml::activeFileField($model, 'image') ?>

        <?php //echo Chtml::error($model, 'name'); ?>


    <div class="row submit">

        <?php echo "<br>" . CHtml::imageButton(Yii::app()->request->baseUrl . '/images/upload.png', array('submit' )); ?>


    <?php echo CHtml::endForm(); ?>

</div><!-- form -->

my doubt is, where i put this following code in this view.

//form options array...

'htmlOptions' => array(

        'enctype' => 'multipart/form-data',



that goes in the form:

<?php $form=$this->beginWidget('CActiveForm', array(




)); ?>