To change the location of where you want the files to uploaded to do, you have to do the following
NOTE: you have to move the files and create the folders for the existing articles. Contact me if you have questions.
Save and close the parameters tab. Next is php code
The file you want to edit is located under [joomla Directory]\administrator\components\com_k2\models\item.php
thats it. Save the file. Restarts IIS or Apache and you should be good to go.
NOTE: you have to move the files and create the folders for the existing articles. Contact me if you have questions.
- In Joomla Administration, go to Components->K2->Items
- Click on Parameters in the Menu tab (same line as KB Items)
- In the advanced tab in the parameters menu, enter the folder name for Change root attachment
- folder
- for some reason, the attachments are put under the administration folder. This is important for the latter steps
- Using notepad++, you can search for 'attachmentsFolder'. There should be three instances
- For the first instance, change the code
- from $path = $params->get('attachmentsFolder', NULL);
- to $path = $params->get('attachmentsFolder', NULL)."/".$row->id;
- For second instance, change the code
- from $path = $params->get('attachmentsFolder', NULL).;
- to $path = "administrator\\".$params->get('attachmentsFolder', NULL)."\\".$attachment->itemID;
- For the third instance, change the code
- from $path = $params->get('attachmentsFolder', NULL);
- to $path = "administrator\\".$params->get('attachmentsFolder', NULL)."\\".$itemID;