Jump to:

1030 Posts in 805 Topics by 311 members

Forum Module

SilverStripe Forums » Forum Module » Post Attachments

Discuss the Forum Module.

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

Page: 1
Go to End
Author Topic: 1695 Views
  • staylor
    Avatar
    Community Member
    7 Posts

    Post Attachments Link to this post

    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?

  • staylor
    Avatar
    Community Member
    7 Posts

    Re: Post Attachments Link to this post

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

  • Jellygnite
    Avatar
    Community Member
    11 Posts

    Re: Post Attachments Link to this post

    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);

  • _Vince
    Avatar
    Community Member
    158 Posts

    Re: Post Attachments Link to this post

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

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

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