Jump to:

10928 Posts in 2612 Topics by 1809 members

All other Modules

SilverStripe Forums » All other Modules » Secure Files module in SS v.3

Discuss all other Modules here.

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

Page: 1 2
Go to End
Author Topic: 1545 Views
  • mimamo
    Avatar
    Community Member
    22 Posts

    Re: Secure Files module in SS v.3 Link to this post

    Hi,
    I'm using Silverstripe 3.05

  • tv
    Avatar
    Community Member
    43 Posts

    Re: Secure Files module in SS v.3 Link to this post

    Beho,

    It has been a couple months since I worked with this, but I believe I was able to get the module working in 3.0.x by using normann's pull request on github.

  • mimamo
    Avatar
    Community Member
    22 Posts

    Re: Secure Files module in SS v.3 Link to this post

    Hi,
    ähm, where should i put the extensions.yml and routes.yml?

    should i create a new folder in the modules root direcotry called _config?

    edit: i put them in cms/_config
    was that right?

  • mimamo
    Avatar
    Community Member
    22 Posts

    Re: Secure Files module in SS v.3 Link to this post

    thx a lot it seems to work now.
    but one problem is left.
    i can't access my page where i upload the files. i always receive an server error ... :/

    here that's the pagetype and dataobject code:

    <?php
    class FilesObject extends DataObject {

    static public $db = array(
    'SortID' => 'Int',
    'Project' => 'Text',
    'Date' => 'Date'
    );

    static public $has_one = array (
       'ProjectFile' => 'File',
    'ClientPage' => 'ClientPage'
    );

    static $summary_fields = array(
    'Project',
    'Date',
    'ProjectFile'
    );

    public static $default_sort = 'SortID Asc';

    public function getCMSFields() {
    DateField::set_default_config('showcalendar', true);
          $file = new UploadField('ProjectFile', 'Datei');
       $file->setFolderName('Clients');

    return new FieldList(
    new TextField('Project', 'Projekt'),
    DateField::create('Date', 'Datum')->setConfig('showcalendar', true),
    $file
    // $visual,
    );

    }

    }

    <?php
    class ClientPage extends Page {

       
    static $has_many = array(
          'Files' => 'FilesObject'
    );
       
       public function getCMSFields() {
          $fields = parent::getCMSFields();
          
          $fields->addFieldToTab('Root.Dateien', GridFieldBase::getGridField('Dateien', _t('Dict.Dateien', 'Dateien'), $this->Files()));
          
          return $fields;
       }
    }

    class ClientPage_Controller extends Page_Controller {

    }

    is there a mistake in my code?

    i hope you could help me.

    thx in advance
    benni

    edit: i added the debug output. but it says nothing to me :/

    Attached Files
    1545 Views
Page: 1 2
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.