I already fixed it, the problem wasn´t the order, the problem was that when you do
$values = $form->getValues(); It automatically receive the files. So you have to set this in the form element ->setValueDisabled(true) So you have to call the $file->receive(); after you configure the new name. ::: Diego Potapczuk »» Analista de sistemas »» Tel: (71) 3287-8343 / (71) 9144-3062 »» http://www.diegoliveira.com.br On Mon, Dec 21, 2009 at 3:52 PM, Daniel Latter <[email protected]> wrote: > I think the order is important:? > > // > http://www.zfforums.com/zend-framework-components-13/core-infrastructure-19/zend-form-element-file-rename-working-but-question-1940.html > * Check if the file was uploaded > * Check if the file is valid > * Add the filter > * Receive the file > > Dan > > > > > > 2009/12/21 Diego Potapczuk <[email protected]> > > Hi, >> >> I need to rename a file with the id of a record that i'm saving in the >> same form, so in the controller i already checked if it is a post, if the >> data is valid, already saved my record in the database, and now i have the >> id. So i need to check if the file was submitted and rename it. I tried it >> without luck. >> >> /* @var $file Zend_Form_Element_File */ >> $file = $form->file; >> if($file->isUploaded()){ >> $file->addFilter('Rename', array('target' => >> realpath('..\public\contents').'\\'.$id, >> 'overwrite' => true)); >> $file->receive(); >> } >> >> The receive execute the filter? How can i execute it? >> How could it perform this? >> How to get the extension of the file? >> >> >> ::: Diego Potapczuk >> > >
