Size Limit Not Showing The Error Message


recently im working on upload picture.

issue is : whenever i uploaded file limit size more than 10 mb the error message is not appearing from model, instead of the showing error message from apache.

PHP.ini-settings already changed to 10mb

post_max_size = 10M

upload_max_filesize = 10M

my profilepciture controller

public function actionUpdate($id)


$default=new Profilepicture;


// Uncomment the following line if AJAX validation is needed

// $this->performAjaxValidation($model);

if(isset($_POST['Profilepicture' ]))





	if($model->ProfilePicture_Image == 'default.png')	{

		$rnd = rand(0,9999);  // generate random number between 0-9999



		$fileName = "{$rnd}-{$uploadedFile}";  // random number + file name

		$model->ProfilePicture_Image = $fileName;


		$_POST['Profilepicture']['ProfilePicture_Image'] = $model->ProfilePicture_Image;







 				 // check if uploaded file is set or not




				Yii::app()->user->setFlash('success','Gambar pemohon berjaya upload');












my model -profilepicture

public function rules()


		// NOTE: you should only define rules for those attributes that

		// will receive user inputs.

		return array(

			//array('ProfilePicture_Image', 'required'),

			array('ProfilePicture_Image', 'file','types'=>'jpg, gif, png',  'maxSize'=>1024 * 1024 * 1, 'tooLarge'=>'File has to be smaller than 1MB' , 'allowEmpty'=>true, 'on'=>array('insert','update')), // this will allow empty field when page is update (remember here i create scenario update)

			array('Fk_ApplicantDetail', 'safe'),

			array('Fk_ApplicantDetail', 'numerical', 'integerOnly'=>true),

			//array('ProfilePicture_Image', 'length', 'max'=>255 ,'tooLong' => '{attribute} is too long (max {max} chars).', 'on' => 'update'),

			// The following rule is used by search().

			// Please remove those attributes that should not be searched.

			array('Profile_Id, ProfilePicture_Image, Fk_ApplicantDetail', 'safe', 'on'=>'search'),




still dont know where is the mistake.

pls guide me.


hi ,

i found the solution already,

post_max_size = 10M

upload_max_filesize = 10M

change to 25M.

now the error showing!!!


its mean i need to increase the post & upload size set it to high value,

then let the model handle the file limitation.

heheh ;D