title: how to get the path and file name of a uploaded file in Zend framework
body: <p>I have form which allow users to upload a file. From my controller I want to get the path with filename. I am using getFileName() method. But it gives the below error:</p>
  
  <pre><code>Message: Method getFileName does not exist 
  </code></pre>
  
  <p>Below is my controller action:</p>
  
  <pre><code>public function addAction()
      {
          $form = new Application_Form_Student();
          $form-&gt;setAttrib('enctype', 'multipart/form-data');
          $form-&gt;submit-&gt;setLabel('Add');
          $this-&gt;view-&gt;form = $form;
  
          if ($this-&gt;getRequest()-&gt;isPost()) {
              $formData = $this-&gt;getRequest()-&gt;getPost();
              if ($form-&gt;isValid($formData)) {
                  $name = $form-&gt;getValue('name');
                  $email = $form-&gt;getValue('email');
                  $photo = $form-&gt;getValue('photo');
                  $location = $form-&gt;getFileName('photo'); 
                  $students = new Application_Model_DbTable_Students();
                  $students-&gt;addStudent($name, $email);
  
                  $this-&gt;_helper-&gt;redirector('index');
              } else {
                  $form-&gt;populate($formData);
              }
          }
  
      }
  </code></pre>