Hi i can upload only <1mb but i cant upload more than that…
heres my rules
array('zipfile','file','types'=>'rar,zip,tar', 'maxSize' => 100*(1024*1024),'minSize'=>1024, 'on'=>'create','allowEmpty'=>false),
//controller
if(isset($_POST['theme']))
{
$model->attributes=$_POST['theme'];
$uploadedFile=CUploadedFile::getInstance($model,'theme');
$model->theme = $uploadedFile;
if($model->save())
{
$uploadedFile->saveAs(Yii::app()->basePath.'/../themes/'.$uploadedFile);
$zip=new ZipArchive;
if ($zip->open(Yii::app()->basePath.'/../themes/'.$uploadedFile)===true) {
$zip->extractTo(Yii::app()->basePath.'/../themes/');
$zip->close();
}
$this->redirect(array('admin'));
}
}
//my form
<div class="form" align="right">
<?php $form=$this->beginWidget('CActiveForm', array(
'id'=>'theme-form',
'enableAjaxValidation'=>false,
'htmlOptions' => array(
'enctype' => 'multipart/form-data',
),
)); ?>
<?php echo $form->errorSummary($model); ?>
<div class="row">
<?php echo CHtml::activeFileField($model,'theme');
echo $form->error($model,'theme'); ?><br/>
<i> Note: Maximum size to upload is 1Mb.</i>
</div>
<div class="row buttons">
<?php echo CHtml::submitButton($model->isNewRecord ? 'Create' : 'Save'); ?>
</div>
<?php $this->endWidget(); ?>
</div><!-- form -->