Upload Excel file

Hi all…

I want to ask about How to upload file on local directory

This is my situation :

  1. I use Win Xp

  2. I have followed

This is My Code in Controller :

public function actionCreate()


		$model=new StudentA;




                        $model->Excel = $_POST['StudentA']['Excel'];

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











I still have an error on :

are there any one know about this problem.

Thanks a lot

I guess that you should save like $model->Excel->saveAs(’.\Temporary\uniqueNameForExcelFile.xls’)

Why not to save in a blob? It’s easier and avoid problems of removing old file, write permission and so on.