according to your code, i try to rewrite it to something like this:

//form model
class forms_ImportForm extends Zend_Form
{
  public function init()
  {
      $this->setMethod('post');

      $uploadFile = new Zend_Form_Element_File('extract');
      $uploadFile->setLabel('File')
                 ->setDestination(APPLICATION_PATH . '/../data');
      $uploadFile->addValidator('Count', false, 1);

      $submit = new Zend_Form_Element_Submit('submit');
      $submit->setLabel('Submit');

      $this->setAttrib('enctype', 'multipart/form-data');
      $this->addElements(array($uploadFile, $submit));
  }
}

// controller

  public function fileAction()
  {
      $fileform = new forms_ImportForm();
      $this->view->fileform = $fileform;

      $req = $this->getRequest();
      if($this->getRequest()->isPost())
      {
          if($fileform->isValid($req->getPost()))
          {
              if(!$fileform->extract->receive())
              {
                  $this->view->msg = 'upload error';
              }
          }
      }
  }
  
i try this code on Windows, and it works fine..
http://framework.zend.com/manual/en/zend.form.standardElements.html
-- 
View this message in context: 
http://zend-framework-community.634137.n4.nabble.com/setDestination-in-Zend-Form-Element-File-tp2316644p2316954.html
Sent from the Zend Framework mailing list archive at Nabble.com.

Reply via email to