mirror of
https://github.com/drakkan/sftpgo.git
synced 2025-12-07 23:00:55 +03:00
event rules: allow to set min/max file size using "human" notation
10MB or 1GB instead of the size in bytes Signed-off-by: Nicola Murino <nicola.murino@gmail.com>
This commit is contained in:
@@ -1077,8 +1077,8 @@ func (f *ConditionOptions) validate() error {
|
||||
}
|
||||
if f.MinFileSize > 0 && f.MaxFileSize > 0 {
|
||||
if f.MaxFileSize <= f.MinFileSize {
|
||||
return util.NewValidationError(fmt.Sprintf("invalid max file size %d, it is lesser or equal than min file size %d",
|
||||
f.MaxFileSize, f.MinFileSize))
|
||||
return util.NewValidationError(fmt.Sprintf("invalid max file size %s, it is lesser or equal than min file size %s",
|
||||
util.ByteCountSI(f.MaxFileSize), util.ByteCountSI(f.MinFileSize)))
|
||||
}
|
||||
}
|
||||
if config.IsShared == 0 {
|
||||
|
||||
Reference in New Issue
Block a user