unclecheese/silverstripe-dropzone

Limit number of files uploadable

Closed this issue · 3 comments

Is there a way to limit the number of files a user can upload? Much like UploadField has a setAllowedMaxFileNumber method.

Yeah, there's a maxFiles setting. https://github.com/unclecheese/silverstripe-dropzone/blob/master/javascript/dropzone.js#L302

Problem is there's no API for it. Can you try creating:

public function setMaxFiles($num)
{
    $this->settings['maxFiles'] = $num;
    return $this;
}

And if that works, submit as a PR?

It works great, awesome module :)

Cheers!