fileUploadErrorAttack - File was illegally uploaded. This could be a possible attack

  It occurs when you try to get the File upload data after the Form getValues() function.
  First you have to add code for File upload data then the form values.

  Ex:
     if ($this->getRequest()->isPost()) {
       if($this->formObj->isValid($_POST)) {

               //Form upload section
                   $upload = new Zend_File_Transfer_Adapter_Http();
           
        $upload->addValidator('Count', false, array('min' =>0, 'max' => 1))
                ->addValidator('IsImage', false, 'jpeg,pjpeg,jpg,png,gif')
                  ->addValidator('Size', false, array('max' => '10MB'))
                       ->setDestination('upload_path');

                 try {
               
             $upload->receive();
                    
           } catch (Zend_File_Transfer_Exception $e) {
     
             die('ERROR'.$e->getMessage());
         }
              //Get form values

              $postValues = $this->formObj->getValues();

          }
      }

How to set value for multiple select options in Zend_Form_Element_Multiselect

We can do that using the setValue function by passig array of selected values
Ex:
    $users = new Zend_Form_Element_Multiselect("users");
    $users->setLabel("Users");
    $users->addMultiOptions(array('1'=>'John Smith','2'=>'Aaron Brown','3'=>'David Beckham');
    $users->setValue(array(1,2));
    so the names John and Aaron will be shown as selected.

Disable HTML Select Option in Zend Form

We can do that using the setAttribs function in the Zend Form Element

   Ex:
      $roles = new Zend_Form_Element_Select("roles");
      $roles->setLabel("Roles");
      $roles->addMultiOptions(array('1' => 'Admin', '2'=>'Group Admin','3'=>'User'));
      suppose if we want to set it disable if the user is 'User'.
          if($roleValue > 2)
        $roles->setAttribs(array('disabled'=>'disabled'));

How to pass variable with _redirector helper zend framework

$this->_helper->_redirector('action','controller','module',array('param1'=>'value1'));

Zend Db function to get column names

$result = $this->db->query($sql_query);
$result->setFetchMode(Zend_Db::FETCH_NUM);
$metaData = $this->db->describeTable('tableName');
$columnNames = array_keys($metaData);

Zend Framework perform action without the view page

$this->_helper->viewRender->setNoRender()

OR

$this->getHelper('viewRenderer')->setNoRender()

Zend framework select() query with OR condition

$selectQry = $this->db->select()->where('fieldname = ?','value')
->orWhere('fieldname = ?','value);