23007 Posts in 11866 Topics by 2828 members
|Go to End|
5 May 2010 at 9:14am Last edited: 5 May 2010 9:16am
I have a page type with a $has_one File and a place to upload the file on the CMS. Is there a way that files uploaded for those types of pages can go to a specified directory? for example, I have a 'employee' page and want to upload the resume - when I upload that resume I want it to go to 'assets/resumes' not 'assets'.
so it would be
static $has_one = array(
'Resume' => 'File'
$fields->addFieldToTab('Root.Content.Main', new FileIFrameField('Resume', 'Resume'), 'Content');
in the EmployeePage.php file.
6 May 2010 at 5:51am
6 May 2010 at 1:38pm
Check this thread - http://www.silverstripe.org/customising-the-cms/show/276189#post276189
Not sure if it actually got fixed in 2.4 as I haven't touched that in a while. At least in terms of talking about images. Might be different for files.
7 May 2010 at 6:52am
great this worked!
new ImageField($name, $title, '', '', '', $folderName = null);
and also works with FileIFrameField
|Go to Top|