title: how to name an uploaded file in zend framework
body: <p>I have a form that contains and form of which code goes like this for image</p>
  
  <pre><code>$image-&gt;setDestination(APPLICATION_PATH . '/../public/images/upload'); 
  </code></pre>
  
  <p>and in my controller i have</p>
  
  <pre><code>if($countryForm-&gt;image-&gt;isUploaded())
  { 
    $countryForm-&gt;image-&gt;receive();    
    $countryModel-&gt;addCountry(
      $countryForm-&gt;getValue('name'), 
      $countryForm-&gt;getValue('description'),
      $this-&gt;view-&gt;baseUrl('/images/upload/'.basename($countryForm-&gt;image-&gt;getFileName()))
    );
  }
  </code></pre>
  
  <p>how can i change the name of the filename uploaded. I want to set it to </p>
  
  <pre><code>random(100).time().ext
  </code></pre>
  
  <p>trying this code</p>
  
  <pre><code> if($form-&gt;image-&gt;isUploaded()){
     $upload = new Zend_File_Transfer();
     $upload-&gt;addFilter('Rename', array('target' =&gt; APPLICATION_PATH.'/../images/upload/'.time().'.jpg', 'overwrite' =&gt; true));
     $form-&gt;image-&gt;receive();
     $filename = $form-&gt;image-&gt;getFilename(); 
     $pageModel-&gt;addPage($form-&gt;getValue('pagetitle'),
     $form-&gt;getValue('pagemetakeyword'),
     $form-&gt;getValue('pagemetadescription'),
     $form-&gt;getValue('pagecategory'),
     $filename,
     $form-&gt;getValue('pagecontent'),
     $form-&gt;getValue('pagestatus')
    );   
  
  }
  </code></pre>
  
  <p>would still give  'backend/public/images/upload/picture.jpg' in my database</p>
  
  <p>I have in my form the following code</p>
  
  <pre><code> $image = $this-&gt;createElement('file', 'image'); 
   $image-&gt;setLabel('Image: '); 
   $image-&gt;setRequired(FALSE); 
   $image-&gt;setDestination(APPLICATION_PATH . '/../public/images/upload/'); 
   $image-&gt;addValidator('Count', false, 1); 
   $image-&gt;addValidator('Size', false, 1024000); 
   $image-&gt;addValidator('Extension', false, 'jpg,jpeg,png,gif'); 
   $this-&gt;addElement($image); 
  </code></pre>
  
  <p>and i am using Ubuntu</p>