Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

Customising the CMS

Problem setting directory for file/image uploads


Reply

2 Posts   1072 Views

Avatar
HilaryB

22 December 2009 at 4:31am Community Member, 11 Posts

I want to be able to set the directory that images and files uploaded for a particular pagetype get put in when creating a page in the CMS. I have tried adding a location to the definition of the FileIframeIfield in getCMSFields() -

$fields->addFieldToTab("Root.Content.Summary", new FileIFrameField('Resource', 'Resource', null, null, null, 'assets/resources/case_studies'));

as I have found suggested elsewhere in the forums, the directory exists and is writable. However I find that the files are written to the standard 'assets/uploads' directory instead. Does anyone know why this is? Am I doing something wrong or is this a bug?

I am using 2.3.3 for this installation, however I have had the same problem with a 2.3.4 installation.

Avatar
CodeGuerrilla

14 January 2010 at 7:39pm (Last edited: 9 April 2010 6:14pm), Community Member, 105 Posts

Ditto!

I would love this to work it is a know bug, I spent a while trying to fix it and just gave up as it involved hacking too much of the SilverStripe core, to me not being able to do this just creates a big mess in the assets/Uploads folder if you use the [url=http://doc.silverstripe.org/doku.php?id=fileiframefield]FileIframeField[/url] you can select an existing file and manage the files and folders in Files/Images this is how I train the clients to use it keeps it neat.

**** BUMP *****

Can the devs comment on a solution or when this is going to be fixed?

**** BUMP *****