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 |
Accept | Accepted upload file types, see input accept Attribute | string | no |
Action | Required parameters, uploaded address | string | no |
BeforeUpload | Before uploading files hooks, parameters for the uploaded files, if returned to | (file, fileList) => | no |
CustomRequest | By overriding the default upload behavior, you can customize your own upload implementation. Note: Be sure what | (item) => | no |
Data | Upload the required parameters or return upload methods. Note: Be sure what | 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, | number | 0 |
FileType | Limit the file type, for example: | 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 | string | 'text' |
Multiple | Whether to support multiple-choice 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 | (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 | (file: UploadFile) => boolean | Observable<boolean> | no |
(Change) | Callback when upload file status changes | EventEmitter |
Last updated