Surprised this has't intruiged anyone.
Well, I'm going through the requirements of this.
Backup first!
Page to modify:
administrator > components > com_k2 > models > item.php
Line 493 & 497
Also for the delete function: line 1030
$path = $params->get('attachmentsFolder', NULL);
if (is_null($path))
{
// start edit to define disting category upload path added $row->catid
$savepath = JPATH_ROOT.DS.'media'.DS.'k2'.DS.'attachments' . $row->catid;
// original
//$savepath = JPATH_ROOT.DS.'media'.DS.'k2'.DS.'attachments';
}
else
{
$savepath = $path;
}
for the actual download, we also need to get access to the category id;
find:
tried adding:
$db = &JFactory::getDBO();
$user = &JFactory::getUser();
$row = &JTable::getInstance('K2Item', 'Table');
But this doesn't work. Anyone got any ideas?
Perhaps this isn't the best way to do it, but initial tests have shown it works, and of course needs documenting, testing, and backing up.
Each update to k2 will destroy these changes, so, maybe not the best...