Jump to:

7935 Posts in 1536 Topics by 943 members

DataObjectManager Module

SilverStripe Forums » DataObjectManager Module » FileDataObjectManager - How to choose existing file but leave it in its current folder?

Discuss the DataObjectManager module, and the related ImageGallery module.

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

Page: 1
Go to End
Author Topic: 911 Views
  • flipsidenz
    Avatar
    Community Member
    49 Posts

    FileDataObjectManager - How to choose existing file but leave it in its current folder? Link to this post

    Hi,

    I've implemented FileDataObjectManager on a website.

    For the sake of keeping uploaded files tidy, I have created multiple folders for different topics on my site.

    However, when I use FileDataObjectManager to "Choose Existing" file, the file is imported to a single folder (Uploads by default).

    This then has created duplicates of files imported in this manner.

    Is there any way to allow the files to sit in their original folder, instead of being duplicated? This would be my preference, so if anyone can help me come up with a solution that would be fantastic.

    Mike

  • Sphere
    Avatar
    Community Member
    44 Posts

    Re: FileDataObjectManager - How to choose existing file but leave it in its current folder? Link to this post

    Quite simple actually...

    the DOM file-manager has a static:
       public static $copy_on_import = true;
    When building your fileupload, just say $fileuploadfield->setCopyOnImport(false);

    That should do the job.

    (Where $fileuploadfield offcourse should be replaced with the variable you used)

    911 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.