Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface FilesValidationOptions

remarks

@since 2.9.0

Hierarchy

Index

Properties

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"];
isValidFileName: IsValidFileName

{@inheritDoc IsValidFileName}

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

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

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

totalBytes: number

The total number of bytes in the FileUploadHookReturnValue.stats list. This is really just:

const totalBytes = stats.reduce((total, stat) => total + stat.file.size, 0);
totalFileSize: number

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

defaultvalue

-1

totalFiles: number

The total number of files in the FileUploadHookReturnValue.stats.

Generated using TypeDoc