File Upload

hello guys, my upload code is failing to send data to the database,my cod is as follows:

The Controller:

<?php

class UploadController extends Controller

{

function actionIndex()

{

  &#036;dir = Yii::getPathOfAlias('q5394727.uploads');


  &#036;uploaded = false;





  &#036;model=new Upload();





  if(isset(&#036;_POST['Upload']))


  {


      &#036;model-&gt;attributes=&#036;_POST['Upload'];


      &#036;file=CUploadedFile::getInstance(&#036;model,'file');


      if(&#036;model-&gt;validate()){


       &#036;uploaded = &#036;file-&gt;saveAs(&#036;dir.'q5394727.upload'.&#036;file-&gt;getName());


		


		//&#036;uploaded=&#036;file-&gt;saveAs(Yii::app()-&gt;basePath.&#036;fileName);


    }


 }





  &#036;this-&gt;render('index', array(


     'model' =&gt; &#036;model,


     'uploaded' =&gt; &#036;uploaded,


     'dir' =&gt; &#036;dir,


  ));

}

}

THE MODEL:

<?php

class Upload extends CFormModel

{

public $file;

public function rules()

{

    return array(


        array('file', 'file', 'types'=&gt;'docx', 'allowEmpty'=&gt;true, 'on'=&gt;'insert,update'),


    );


}

}

THE VIEW:

<?php

/* @var $this UploadController */

$this->breadcrumbs=array(

'Upload',

);

?>

<h1><?php echo $this->id . ‘/’ . $this->action->id; ?></h1>

<?php if($uploaded):?>

<p>File was uploaded. Check <?php echo $dir?>.</p>

<?php endif ?>

<?php echo CHtml::beginForm(’’,‘post’,array(‘enctype’=>‘multipart/form-data’))?>

<?php echo CHtml::error($model, ‘file’)?>

<?php echo CHtml::activeFileField($model, ‘file’)?>

<?php echo CHtml::submitButton(‘Upload’)?>

<?php echo CHtml::endForm()?>

<p>

You may change the content of this page by modifying


the file &lt;tt&gt;&lt;?php echo __FILE__; ?&gt;&lt;/tt&gt;.

</p>

HOW AM I SUPPOSED TO SPECIFY THE PATH?

I TRIED THIS CODE ON THE LOCAL SERVER AND ON THE ONLINE SERVER. PLEASE HELP :(