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.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

All other Modules /

Discuss all other Modules here.

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

User forms - links to uploaded files


Go to End


3 Posts   1904 Views

Avatar
justinv

Community Member, 8 Posts

15 June 2010 at 12:32pm

Hi, I've been using user forms. I've got a file upload form and want to put links to all uploaded files on the same page as the form.

Can anyone help?

Thanks

Avatar
Willr

Forum Moderator, 5523 Posts

15 June 2010 at 4:42pm

Are you talking about putting links to the files on the front end of the site rather than the CMS?.

You would need to write your own function to get the files and then some template code to display it. So the function to get the uploaded files would look like

// note will only work for UDF 0.3
function getUserformsUploads() {
return DataObject::get('SubmittedFileField');
}

Then in your template file you would loop over that to output the uploads.

<% control UserformsUploads %>
$FormattedValue
<% end_control %>

Avatar
justinv

Community Member, 8 Posts

18 June 2010 at 6:19pm

Yes that's what I was looking for.

Thanks, much appreciated.