Hi !
i am trying to get muplidify to work but unfortunately the action in the script in widget does not get called. i have followed all instruction given. the action in scriptCheck does get called . any help would be appreciated.
Following are the code snippet :
View :
$this->widget(‘ext.uploadify.MUploadify’,array(
'name'=>'image',
'buttonText'=>Yii::t('application','Browse'),
'script'=>array('photo/uploadfile'),
'method'=>'post',
'fileExt'=>'*.jpg;*.png;',
'multi'=>false,
'sizeLimit'=>602400,
'auto'=>false,
));
Controller :
public function init(){
if(isset($_POST[‘SESSION_ID’])){
$session=Yii::app()->getSession();
$session->close();
$session->sessionID = $_POST['SESSION_ID'];
$session->open();
}
}
public function actionUploadfile(){
$path = path for image
if(isset($_POST[‘image’])){
$image = CUploadedFile::getInstanceByName('image');
$image = $image->getName('image');
$image_url = $path.$image;
if(!$image->saveAs($image_url))
throw new CHttpException(500);
echo true;
Yii::app()->end();
}
}
Regards