Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface FileValidationOptions

remarks

@since 2.9.0

Hierarchy

Index

Properties

Optional extensions

extensions: readonly string[]

An optional list of extensions to enforce when uploading files.

Note: The extensions and file names will be compared ignoring case.

example

Only Allow Images

const extensions = ["png", "jpeg", "jpg", "gif"];

Optional isValidFileName

isValidFileName: IsValidFileName

{@inheritDoc IsValidFileName}

Optional maxFileSize

maxFileSize: number

An optional maximum file size to enforce for each file. This will only be used when it is greater than 0.

defaultvalue

-1

Optional maxFiles

maxFiles: number

If the number of files should be limited, set this value to a number greater than 0.

Note: This still allows "infinite" files when set to 0 since the <input> element should normally be set to disabled if files should not be able to be uploaded.

defaultvalue

-1

Optional minFileSize

minFileSize: number

An optional minimum file size to enforce for each file. This will only be used when it is greater than 0.

defaultvalue

-1

Optional totalFileSize

totalFileSize: number

An optional total file size to enforce when the maxFiles option is not set to 1.

defaultvalue

-1

Generated using TypeDoc