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.

Archive /

Our old forums are still available as a read-only archive.

Moderators: martimiz, Sean, Ed, biapar, Willr, Ingo

Define upload directory for FileFields

Go to End

2 Posts   1667 Views


Community Member, 46 Posts

6 April 2008 at 6:01am

Edited: 06/04/2008 6:05am

Hi there,

I want to define the upload directory for different fields that i am using in the cms to keep them organised. For example...

$fields->addFieldToTab("Root.Content.Files", new FileIFrameField('SermonMP3', 'MP3 Audio'));
$fields->addFieldToTab("Root.Content.Files", new FileIFrameField('SermonPDF', 'PDF Download'));

I want the MP3 to save into "/assets/MP3" and PDF to save into ".assets/PDF".

Is there anyway to do this?


Forum Moderator, 801 Posts

6 April 2008 at 6:52pm

currently you can't switch uploads based on their mimetype out of the box - please subclass FileIframeField and overwrite its saveInto() method. would be great if you can provide your customization in the forum, perhaps we can find a way to integrate this into the core.