2013-05-25 2 views
3

Я просто пытаюсь загрузить pdf-файл в свой проект (закодирован с Zend Framework 2). Я просто не могу понять, почему ничего не загружено.Pdf Загрузить в Zend Framework 2

Контроллер:

$this->adapter = $this->getServiceLocator()->get('db-adapter'); 
    $jobModel = new Model\JobModel($this->adapter); 
    $form = EnterContentForm::getEnterContentFormJob($this->serviceManager); 
    $templateData = $this->getServiceLocator()->get('TemplateData'); 
    $templateData->addTemplateData(array(
      'ckEditor' => true 
    )); 


    if($this->getRequest()->isPost()){ 
        $pdfFile = $this->params()->fromFiles('pdf'); 

     $data = array_merge_recursive(
       $this->getRequest()->getPost()->toArray(), 
       $this->getRequest()->getFiles()->toArray() 
     ); 
     $isPdf = new \Zend\Validator\File\MimeType('application/pdf'); 
     $form->setData($postData); 


     if($form->isValid()){ 
      if($isPdf->isValid($pdfFile)){ 
       $adapter = new \Zend\File\Transfer\Adapter\Http(); 
       $adapter->setDestination("static_content\media\pdfs\jobs"); 
       $adapter->receive($pdfFile['name']); 
      }} 

Я не могу понять, почему ничего не загружается. Я перепробовал много способов, но ни один из них не работал, как:

Abdul Malik Ikhsan's Blog

Zend Doku

Благодарности

ответ