My form:
<?php
$form=$this->beginWidget('CActiveForm', array(
'id'=>'news-form',
'htmlOptions'=>array('enctype'=>'multipart/form-data'),
));
?>
<div class="form-group col-sm-12 col-md-6">
<?php echo $form->labelEx($news,'state'); ?>
<?php echo $form->dropDownList($news,'state', CHtml::listData($op,'Value','Type'),array('class' => 'form-control')) ?>
<?php echo $form->error($news,'state'); ?>
</div>
<!-- HERE MY PROBLEM -->
<input type="file" name="original" onchange="change(event)" id="original" />
<?php echo CHtml::submitButton(Yii::t('app','CreateNewsLabel'), array('class' => 'btn btn-primary'), $news->isNewRecord ? 'Create' : 'Save'); ?>
When into my Controller I try to get file, that doesn't exists:
if (isset($_FILE['original'])) {
//..
}
The if is never executed. I have tried a lot of possible solutions but doesn' work. I dont understand the reason because I'm using mulipart/form-data and should be exists...
Thanks you, regards.