Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

DataObjectManager Module /

Discuss the DataObjectManager module, and the related ImageGallery module.

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

download file link in FileDataObjectManager with ModelAdmin

Go to End

2 Posts   1260 Views


Community Member, 72 Posts

1 June 2011 at 4:43am

I have built some front end forms that allows users to upload pdfs and doc(x) files, using UncleCheese's tutorial:

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?



Forum Moderator, 4102 Posts

2 June 2011 at 1:43am

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: