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

Optional concurrency

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

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 getFileParser

getFileParser: GetFileParser

{@inheritDoc GetFileParser}

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 onChange

onChange: ChangeEventHandler<HTMLInputElement>

Optional onDrop

onDrop: DragEventHandler<E>

Optional totalFileSize

totalFileSize: number

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

defaultvalue

-1

Optional validateFiles

validateFiles: FilesValidator<CustomError>

{@inheritDoc FilesValidator}

Generated using TypeDoc