Yii Framework Forum: Lost Ajax Error Message - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Lost Ajax Error Message image upload and lost error message Rate Topic: -----

#1 User is offline   Ashish Rastogi 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 2
  • Joined: 17-September 13

Posted 16 January 2014 - 10:50 AM

public function actionCreate()
{
$model=new Addwithus;

// Uncomment the following line if AJAX validation is needed
// $this->performAjaxValidation($model);

if(isset($_POST['Addwithus']))
{

$rnd = rand(10,99999); // generate random number between 0-9999
$model->attributes=$_POST['Addwithus'];

$uploadedFile=CUploadedFile::getInstance($model,'pic');
$fileName = "{$rnd}-{$uploadedFile}"; // random number + file name
$model->pic = $fileName;


if($model->save())

$uploadedFile->saveAs(Yii::app()->basePath.'/../images/upload/'.$fileName);
$this->redirect(array('/site/thanks'));
}


$this->render('create',array(
'model'=>$model,
));
}
0

#2 User is offline   Ashish Rastogi 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 2
  • Joined: 17-September 13

Posted 16 January 2014 - 10:54 AM

When i user this image upload function then i lost AJAX error message could you tell what is the problem????
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users