I need to upload image with ajax call. But POST field with image always is empty. Part of my form:
<div class="col-lg-6">
<?php echo CHtml::activeFileField($model, 'logo'); ?>
<?php echo CHtml::textField('test', 'test'); ?>
<?php echo CHtml::submitButton('Upload'); ?>
<?php echo CHtml::ajaxSubmitButton('Upload ajax', '#');?>
</div>
If i click submitButton
, then i have both test
and logo
fields - image uploaded.
And if i click ajaxSubmitButton
, then i have only test
field, logo
is empty. What is the solution?
PS: i need non-extension solution.