Jump to:

7939 Posts in 1472 Topics by 944 members

DataObjectManager Module

SilverStripe Forums » DataObjectManager Module » download file link in FileDataObjectManager with ModelAdmin

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: 903 Views
  • moloko_man
    Avatar
    Community Member
    72 Posts

    download file link in FileDataObjectManager with ModelAdmin Link to this post

    I have built some front end forms that allows users to upload pdfs and doc(x) files, using UncleCheese's tutorial: http://www.leftandmain.com/silverstripe-tutorials/2010/08/30/using-uploadify-in-frontend-forms/

    There are two different types of forms that use uploadify;
    1) a has_one relation - user can only upload one file
    2) a has_many relation - user can upload 1 or more files

    Basically these forms are for a company to help out charities and groups that need funding, etc. When these forms are submitted the person in charge is emailed, then they can log in to the back end where I have built a ModelAdmin to view all form submissions (i.e. requests), and download the attached files for reviewing/acceptance.

    In the ModelAdmin on the has_one relation I was able to use a FileIFrameField and there is a link on the file to download the file.

    However in the has_many relation, I'm using a FileDataObjectManager and while I can see which files are attached, there is no link or a way to download the file.

    Is there a way to add a link to file or some other method I'm missing to make the files downloadable from the FileDOM view?

    Thanks.

  • UncleCheese
    Avatar
    4085 Posts

    Re: download file link in FileDataObjectManager with ModelAdmin Link to this post

    I'm not sure that a FileDOM is what you want to be managing that relationship. FileDOMs are for has_many relations to DataObjects that contain a has_one File relation. You're just managing a has_many directly to File, which is what AssetManager is used for.

    --------------------
    SilverStripe tips, tutorials, screencasts and more: http://www.leftandmain.com

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