Limit number of files uploadable
Closed this issue · 3 comments
sanderha commented
Is there a way to limit the number of files a user can upload? Much like UploadField
has a setAllowedMaxFileNumber
method.
unclecheese commented
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?
sanderha commented
It works great, awesome module :)
unclecheese commented
Cheers!