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.

Forum Module /

Discuss the Forum Module.

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

Post Attachments


Go to End


4 Posts   3165 Views

Avatar
staylor

Community Member, 7 Posts

17 September 2009 at 1:50pm

I must be blind because I can see bits of code for post attachments, but can't find a way to post them.

Can someone please guide me on how to post attachments? Is there some secret samurai way?

On a side note, it seems this forum uses that module and there is definitely an Attach File option on this post.

Why does mine not have it?

Avatar
staylor

Community Member, 7 Posts

17 September 2009 at 1:54pm

I fail, forum has permission called Can users attach files? ;\

Avatar
Jellygnite

Community Member, 12 Posts

6 October 2011 at 2:02pm

Edited: 06/10/2011 2:22pm

Apologies for opening an old thread but I was having similar problem.

I found it in the admin area under the topic > Access > Can users attach files?

When changing this however it raised an error

[User Notice] Upload::setAllowedMaxFileSize() is deprecated. Please use Upload_Validator::setAllowedMaxFileSize() instead

To fix change this line in Forum.php (appears twice)

$fileUploadField->setAllowedMaxFileSize(1000000);

to

$f_validator = new Upload_Validator();
$f_validator->setAllowedExtensions(array('pdf','png','jpg')); // set your extensions here
$f_validator->setAllowedMaxFileSize( array('*' => 1000000) );
$fileUploadField->setValidator($f_validator);

Avatar
_Vince

Community Member, 165 Posts

10 August 2012 at 12:09am

Thanks heaps, I've been looking for that for the past few days!

You'd think it'd be under the Settings tab... :P