public function attachFile($file, $data)
{
$vfs = $this->getVFS();
if (!isset($file['change_author'])) {
$file['change_author'] = $GLOBALS['registry']->getAuth();
}
$result = $this->_attachFile($file);
/* We encode the path quoted printable so we won't get any nasty
* characters the filesystem might reject. */
$path = Wicked::VFS_ATTACH_PATH . '/' . $file['page_id'];
try {
$vfs->writeData($path, $file['attachment_name'] . ';' . $result, $data, true);
} catch (Horde_Vfs_Exception $e) {
throw new Wicked_Exception($e);
}
}