I've got a question about renaming a file after it's been uploaded in Zend. I don't know where to put the Rename Filter. Here's what I've got. I've tried moving things around, but I'm lost. Currently it does upload the file to my photos folder, but it doesn't rename it. Thanks for any help!
if($this->_request->isPost())
{
$formData = $this->_request->getPost();
if ($form->isValid($formData))
{
$adapter = new Zend_File_Transfer_Adapter_Http();
$adapter->setDestination(WWW_ROOT . '/photos');
$photo = $adapter->getFileInfo('Photo');
$adapter->addFilter('Rename', array(
$photo['Photo']['tmp_name'],
WWW_ROOT . '/photos/' . $this->memberId . '.jpg',
true
));
if ($adapter->receive())
{
echo 'renamed';
}
}
}