Jump to:

22993 Posts in 11843 Topics by 2828 members

General Questions

SilverStripe Forums » General Questions » UploadField setFolderName to folder outside of assets.

General questions about getting started with SilverStripe that don't fit in any of the categories above.

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

Page: 1
Go to End
Author Topic: 212 Views
  • micahsheets
    Avatar
    Community Member
    164 Posts

    UploadField setFolderName to folder outside of assets. Link to this post

    I have been unhappy ever since I started using SilverStripe back in v2.3 that I cannot override the folder for uploading files to a folder outside of /assets.

    I often have files that must be uploaded and stored that are related to DataObjects, however these files should never show up in the AssetManager or any other CMS interface other than the one I create for managing the relationship. I know that this is hard coded to always make uploads relative to /assets.

    I would like a way to configure UploadField with so that it can use one of two upload root folders. One would be assets and would be used for files meant to be accessed in the CMS for placing in Content etc. The other would be another folder that would have write access for the fileserver but would not be accessible to any other interface than the UploadField that it is set for.

    I think that I may have to extend Upload class and FileField, and UploadField so that I can add this configuration parameter so that I can force UploadField to use either the public_asset root or the protected_asset root.

    Has anyone accomplished something similar already? I know there is SecureFiles Module is much more complex than it needs to be. All we really need is two root folders.

    212 Views
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.