Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface FileUploadOptions<E, CustomError>

remarks

@since 2.9.0

Type parameters

  • E: HTMLElement

    An optional HTMLElement type that is used for the FileUploadHandlers.

  • CustomError = never

    An optional error type that gets returned from the FilesValidator.

Hierarchy

Index

Properties

concurrency?: number

Setting this value to a number greater than 0 will update the browser upload process to queue the uploads in chunks instead of all at once. This can help prevent the browser from freezing if dealing with large files that are being converted to data urls.

defaultvalue

-1

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"];
getFileParser?: GetFileParser

{@inheritDoc GetFileParser}

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

onChange?: ChangeEventHandler<HTMLInputElement>
onDrop?: DragEventHandler<E>
totalFileSize?: number

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

defaultvalue

-1

validateFiles?: FilesValidator<CustomError>

{@inheritDoc FilesValidator}

Generated using TypeDoc