File input control in form: <div class="row"> <img id="preview" width="200px" class="hidden"/> <?php echo CHtml :: label ( "File Foto" , 'file_image' ); ?> <?php echo CHtml :: fileField ( "file_image" , '' , array ( 'accept' => '.jpg' )); ?> <br/> <?php echo CHtml :: button ( "Upload Foto" , array ( 'id' => 'btn-upload' )); ?> </div> Button onclick event: Yii::app()->clientScript->registerScript('upload', " $('#btn-upload').click(function(){ resizeImage(); }); "); Javascript function : < script > function upload(dataurl) { var formData = new FormData($( "#tbl-hdrclaimrusak-form"...