I’m building an upload tool using swfupload. The user will have to fill a form with contact data. This data will be emailed to someone. I would like to send the uploaded file names so I’m trying to save the file names in Yii session but I’m getting error 500 when the upload finishes.
Here is my action that save the files:
public function actionSaveFiles()
{
if (!isset(Yii::app()->session['fileNames'])) Yii::app()->session['fileNames'] = array();
$this->uploadFolder = Yii::app()->basePath . '/../uploads';
$filedata = $_FILES['Filedata'];
$result = move_uploaded_file($filedata['tmp_name'],$this->uploadFolder . '/' . $filedata['name']); // Not relative. Full path
if ($result) {
Yii::app()->session['arquivosEnviados'][] = $filedata['name'];
}
}
If I comment the line bellow, the upload works fine:
I used swfupload extension before and it works fine until i used it on my new project and i got a weird error.
My new project was at the same hosting and with same configuration with my previous project that was working.
$_POST and $_FILES variables are empty and definitely when post variable was empty it will return a csrf validation error. Charles web debugging proxy reported that it was submitting data but when it reaches the server it was empty.