thomasW wrote:
>
> Hy,
> So the logical way in my opinion would be to call getFileName, change the
> name according to the primary key of the database by applying the rename
> filter, and then, as last step calling getValues().
> If validation or anything other fails, revert db entry.
> You could even validate before attaching the rename filter because
> validation does not receive the file.
>
> if ($file->isValid()) {
> $file->getFileName();
> get id, rework filename
> $file->addFilter('rename', $newfilename);
> ->getValues();
> }
>
If I undestood, this way you can't insert data into db calling
$form->getValue(), like I'm used to do:
if($form->isValid()){
$id = $this->dbTable->insert($form->getValue());
$this->getElement('fileUpload')->addFilter('Rename',$id.'.jpg');
}
...meaning getValue() method of Zend_Form is useless for those form using
Zend_Form_Element_File... or had I miss something?
--
View this message in context:
http://www.nabble.com/-Zend_Form--Zend_Form_Element_File%3A%3AgetValue%28%29-is-calling-Zend_File_Transfer_Http%3A%3A-receive%28%29-tp20818332p21055532.html
Sent from the Zend Framework mailing list archive at Nabble.com.