Hi there,
I'm using the following code in Page.php so that I can use filemanager module to attach images to every page:
static $has_many = array(
'Images' => 'Image'
);
public function getCMSFields() {
$fields = parent::getCMSFields();
$manager = new HasManyFileManager(
$this,
'Images', // name -> will be used for file grouping
'Images' // relation name defined in $has_many
);
// creating tab for the "Files" Manager
$fields->addFieldToTab('Root.Content.Images', $manager);
return $fields;
}
public function onBeforeDelete(){
parent::onBeforeDelete();
$this->deleteAttachedFiles();
}
Everything works perfect, except for one thing. All images that I upload are stored in two folders, being /Uploads and /Uploads/AttachedFiles/Images. This doesn't feel right, shouldn't images only be stored in /Uploads/AttachedFiles/Images ?
As there will be a lot of large images on this site, I would really like this solved, because this will cost me twice as much disk space...