Intermittent problems with CUploadedFile to db

I implemented CUploadedFile to upload images to my database but now when testing I am running into a couple of problems. I am having a really hard time tracking down the source of the problems. I have tried this in a couple of different environments of OSX and linux and the errors don’t change.

When I upload most files everything is just fine but when I try files larger than 1MB I often get one of the two errors below.

Failed to set unsafe attribute "uploadedFile".

Error while sending QUERY packet. PID=6429 //or some other number

Here is my code.


public function actionUpload()


        $model->content = CUploadedFile::getInstance($this, 'content');




public function rules() {

    return array(

          array('uploadedFile', 'file', 'types'=>'jpg,JPG,png,PNG','allowEmpty'=>false,'maxSize'=>3242880,'wrongType'=>'jpg or png','tooLarge'=>'Smaller than 3MB'),



protected function beforeSave()









	return parent::beforeSave();



<?php echo $form->fileField($model,'uploadedFile'); ?>

 <?php echo $form->error($model,'uploadedFile'); ?>


upload_max_filesize = 5M

Hello, I have the same problem did you get a solution for this?