Open adiramardiani opened 8 years ago
Does it work if you set the rules inside app config?
'modules' => [
...
'attachments' => [
'class' => nemmo\attachments\Module::className(),
'rules' => [ // Rules according to the FileValidator
'maxFiles' => 10, // Allow to upload maximum 3 files, default to 3
'mimeTypes' => 'image/png', // Only png images
'maxSize' => 1024 * 1024 // 1 MB
],
]
...
]
But I think it will not work. Thus it will be an enhancement. Added to checklist #36
Yes I did not try it inside the app config But what kind of method that can do that ?
It's so I need at this moment, if you could explain a temporary method that allows this currently ? while I waited for the enhancement
Thanks
You can fork or download the whole module and add this feature inside file behavior. I think the right way is to check the file existance on before save event
Sorry, add this feature inside file behavior or check the file existance on before save event, I can't understand how to write it, I was newbie, can you also explain the example code.
(While waiting in the newest version for the best method)
In rule is provided FileValidator, how to add a required option ?