#Author: Adam KuĊ›mierz Index: /Zend/Form/Element/File.php =================================================================== --- /Zend/Form/Element/File.php (revision 12262) +++ /Zend/Form/Element/File.php (working copy) @@ -64,6 +64,13 @@ protected static $_maxFileSize = 0; /** + * Keep processed value + * + * @var string + */ + protected $_value = null; + + /** * Load default decorators * * @return void @@ -580,20 +587,25 @@ */ public function getValue() { - $content = current($this->getTransferAdapter()->getFileInfo()); + if (!is_null($this->_value)) + return $this->_value; + + $content = $this->getTransferAdapter()->getFileInfo($this->getName()); + $content = reset($content); if (!isset($content['name'])) { return null; } - if (!$this->isValid(null)) { - return null; - } + if (!$this->isValid(null)) { + return null; + } if (!$this->receive()) { - return null; + return null; } $filename = basename($this->getFileName()); + $this->_value = $filename; return $filename; } }