File Uploader
Pages Drag and Drop File Uploader
pg-upload is a fork of NG-ZORRO implementation of Dropzone Initial credits go to the author
Importing
First import it to your app module or any submodule as you wish
How to use
Basic Select with Search
API
The server upload interface implementation can refer to jQuery-File-Upload .
parameter
Instructions
Types of
Defaults
Action
Required parameters, uploaded address
string
no
BeforeUpload
Before uploading files hooks, parameters for the uploaded files, if returned tofalse
stop uploading. Note: IE9 does not support this method. Note: Be sure what =>
the definition of treatment.
(file, fileList) => boolean | Observable<boolean>
no
CustomRequest
By overriding the default upload behavior, you can customize your own upload implementation. Note: Be sure what =>
the definition of treatment.
(item) => Subscription
no
Data
Upload the required parameters or return upload methods. Note: Be sure what=>
the definition of treatment.
Object | ((file: UploadFile) => Object)
no
Disabled
Is it disabled
boolean
false
FileList
File list, two-way binding
UploadFile[]
no
Limit
Limit the maximum number of single uploads, Multiple
valid when opened;0
unlimited
number
0
FileType
Limit the file type, for example:image/png,image/jpeg,image/gif,image/bmp
string
no
Filter
Custom filter
UploadFilter[]
no
Headers
Set upload request header, above IE10
object
no
ListType
Upload list of built-in styles, support three basic styles text
,picture
andpicture-card
string
'text'
Multiple
Whether to support multiple-choice files, IE10+
support. After opening, hold down ctrl to select multiple files.
boolean
false
Name
File parameter names sent to the background
string
'file'
ShowUploadList
Whether to display the list, can be set as an object for individually setting showPreviewIcon and showRemoveIcon
Boolean or { showPreviewIcon?: boolean, showRemoveIcon?: boolean }
true
ShowButton
Whether to display the upload button
boolean
true
WithCredentials
Whether to carry a cookie when uploading a request
boolean
false
Preview
Clickback when clicking on a file link or preview icon. Note: Be sure what =>
the definition of treatment.
(file: UploadFile) => void
no
Remove
Click on the callback when the file is removed. If the return value is false, it will not be removed. Support for returning Observable<boolean> objects. Note: Be sure what =>
the definition of treatment.
(file: UploadFile) => boolean | Observable<boolean>
no
(Change)
Callback when upload file status changes
EventEmitter
Last updated