//excerpt
$file = new Zend_Form_Element_File(\'file\');
$file->setLabel(\'File to upload:\')
->setRequired(true)
->addValidator(\'NotEmp
To answer question 1, to get a filename from a full path, you can use basename, or pathinfo.
For example (copy-paste from the doc) :
$path = "/home/httpd/html/index.php";
$file = basename($path); // $file is set to "index.php"
Or :
$path_parts = pathinfo('/www/htdocs/index.html');
echo $path_parts['dirname'], "\n";
echo $path_parts['basename'], "\n";
echo $path_parts['extension'], "\n";
echo $path_parts['filename'], "\n"; // since PHP 5.2.0
To rename / move the file, I suppose rename would do the trick, even if it's quite not "Zend Framework solution".
If the file has not been moved by ZF and is still in the temporary directory, you should use move_uploaded_file -- but as you are using setDestination
, I suppose the file is no longer in the sytem's temporary directory.