Beispiel #1
0
 protected function _upload()
 {
     $configs = \Core_Registry::get('configs');
     $upload = new \Core_Upload('Http', FALSE, $configs['upload']['sistema']);
     if ($upload->getFileName()) {
         // retirando obrigatpriedade do campo
         $upload->setOptions(array('ignoreNoFile' => TRUE));
         return $upload->upload();
     }
     return NULL;
 }
Beispiel #2
0
 public function uploadTempAction()
 {
     $params = $this->_getAllParams();
     $registry = \Zend_Registry::get('configs');
     $result = 'true';
     $data = array('destination' => $registry['folder'][$this->_folder], 'validateMimeType' => FALSE);
     $dtoUpload = Core_Dto::factoryFromData($data, 'Core_Dto_Mapping_Upload', array(1 => 'validateMimeType'));
     $data = array('de_caminho_arquivo' => null);
     $dtoArquivo = Core_Dto::factoryFromData($data, 'entity', array('entity' => $this->_entityTemp));
     $options = $dtoUpload->toArray();
     $upload = new \Core_Upload('Http', FALSE, $options);
     $fileName = $upload->upload();
     $dtoArquivo->setdeCaminhoArquivo($fileName);
     $this->_temp->add($dtoArquivo);
     $this->_helper->layout->disableLayout();
     $this->_helper->viewRenderer->setNoRender(TRUE);
     $this->_response->setBody($result);
 }