Jump to:

5537 Posts in 1737 Topics by 1223 members

Customising the CMS

SilverStripe Forums » Customising the CMS » Problem setting directory for file/image uploads

Moderators: martimiz, Sean, biapar, Willr, Ingo, swaiba, simon_w

Page: 1
Go to End
Author Topic: 1059 Views
  • HilaryB
    Community Member
    11 Posts

    Problem setting directory for file/image uploads Link to this post

    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.

  • CodeGuerrilla
    Community Member
    105 Posts

    Re: Problem setting directory for file/image uploads Link to this post


    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 FileIframeField 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 *****

Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.