This project is no longer maintained and no further public releases are planned.

No further support will be given.

Feel free to fork the git repository.

File Upload

These are all available error checks dealing with file uploads. You can restrict allowed file types, set min and max uploadable files for one upload field and more.

Version added

1.0.0

Example code

validators {
  1.class = Validator\DefaultValidator
  1.config {
    fieldConf {
      images.errorCheck {
        1 = fileAllowedTypes
        1.allowedTypes = jpg,png,gif
        2 = fileMaxCount
        2.maxCount = 5
        3 = fileMaxSize
        3.maxSize = 1048576 # = 1MB
      }
    }
  }
}

fileAllowedTypes

Checks if the filetype of an uploaded file is allowed.

fileMinCount

Checks if the files uploaded from a field are more than or equal the configured value

fileMaxCount

Checks if the files uploaded from a field are less than the configured value

fileMinSize

Checks if the size of an uploaded file is at least the configured value (in Byte)

fileMaxSize

Checks if the size of an uploaded file is less than the configured value (in Byte)

fileMaxTotalSize

Checks if the size of all uploaded file is less than the configured value (in Byte)

fileRequired

Checks if a file has been uploaded from this field