@serenity-is/corelib / UploaderOptions
Interface: UploaderOptions
Properties
accept?
optionalaccept:string
Accept. If not specified, read from the passed input
Defined in
allStart()?
optionalallStart: () =>void
Progress event that is called before first batch start is about to be uploaded
Returns
void
Defined in
allStop()?
optionalallStop: () =>void
Progress event that is called after last batch is ended uploading or failed
Returns
void
Defined in
autoClear?
optionalautoClear:boolean
Auto clear input value after selection, so when same file selected it works. Default is true
Defined in
batchHandler()?
optionalbatchHandler: (batch,uploader) =>void|Promise<void>
Callback to handle a batch. If not specified, a default handler is used.
Parameters
batch
uploader
Returns
void | Promise<void>
Defined in
batchProgress()?
optionalbatchProgress: (data) =>void
Progress event that is called during upload
Parameters
data
data.batch
data.loaded
number
data.total
number
Returns
void
Defined in
batchSize?
optionalbatchSize:number
Only used for multiple, default is 1 to upload multiple files in batches of size 1
Defined in
batchStart()?
optionalbatchStart: (data) =>void
Progress event that is called when a batch is about to be uploaded
Parameters
data
data.batch
Returns
void
Defined in
batchStop()?
optionalbatchStop: (data) =>void
Progress event that is called when a batch is ended uploading or failed
Parameters
data
data.batch
Returns
void
Defined in
batchSuccess()?
optionalbatchSuccess: (data) =>void
Called after batch is uploaded successfully
Parameters
data
Returns
void
Defined in
changeCallback()?
optionalchangeCallback: (e) =>void
Only called when a change/drop event occurs, but files can't be determined
Parameters
e
Event
Returns
void
Defined in
dropZone?
optionaldropZone:HTMLElement|ArrayLike<HTMLElement>
An optional list of dropzones.
Defined in
errorHandler()?
optionalerrorHandler: (data) =>void
Error handler, if not specified Uploader.errorHandler is used
Parameters
data
Returns
void
Defined in
ignoreType?
optionalignoreType:boolean
Ignore file types, e.g. don't check accept property of input or this options
Defined in
input?
optionalinput:HTMLInputElement
Target input. If null, dropZone should be specified.
Defined in
multiple?
optionalmultiple:boolean
Allow multiple files. If not specified is read from the input
Defined in
name?
optionalname:string
The field name to use in FormData object. Default is files[]