You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+165-8Lines changed: 165 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,4 +1,5 @@
1
-
Angular file uploader is an Angular 2/4/5/6/7/8 file uploader module with Real-Time Progress Bar, Angular Universal Compatibility and multiple themes which includes Drag and Drop and much more.
1
+
2
+
Angular file uploader supports angular versions 2.x - 9.x and comes with Real-Time Progress Bar, Responsive design, Angular Universal Compatibility and multiple themes which includes Drag and Drop and much more.
2
3
3
4
### Demo
4
5
<https://kzrfaisal.github.io/#/afu>
@@ -71,8 +72,9 @@ npm i angular-file-uploader
71
72
dragNDropBox:'Drag N Drop',
72
73
attachPinBtn:'Attach Files...',
73
74
afterUploadMsg_success:'Successfully Uploaded !',
74
-
afterUploadMsg_error:'Upload Failed !'
75
-
};
75
+
afterUploadMsg_error:'Upload Failed !',
76
+
sizeLimit:'Size Limit'
77
+
}
76
78
};
77
79
```
78
80
@@ -127,9 +129,9 @@ You have seen that by using 'resetUpload' property, you can reset the module eas
127
129
to reset the module hassle-free anytime.
128
130
129
131
### Styling:
130
-
###### Following classes are available for customisation :
131
-
###### *Include them in your global css class (src/styles.css)*
132
-
###### *Use '!important' if something doesn't works*
132
+
##### Following classes are available for customisation :
133
+
##### *Include them in your global css class (src/styles.css)*
134
+
##### *Use '!important' if something doesn't works*
133
135
- .afu-select-btn {}
134
136
- .afu-reset-btn {}
135
137
- .afu-upload-btn {}
@@ -142,13 +144,15 @@ You have seen that by using 'resetUpload' property, you can reset the module eas
142
144
- .afu-upload-status {}
143
145
- .afu-attach-pin {}
144
146
145
-
##### Points to note:
147
+
#### Points to note:
146
148
- Files are uploaded inFormData format.
147
149
148
150
### Coming Soon:
149
151
- More themes.
150
152
- More customization options.
151
-
153
+
---
154
+
#### For Versions <6.x: [Click Here !](https://github.com/kzrfaisal/angular-file-uploader#for-versions--6x-)
155
+
---
152
156
---
153
157
#### For Versions <5.x: [Click Here !](https://github.com/kzrfaisal/angular-file-uploader#for-versions--5x-)
154
158
---
@@ -158,6 +162,159 @@ You have seen that by using 'resetUpload' property, you can reset the module eas
158
162
#### For Versions <2.x: [Click Here !](https://github.com/kzrfaisal/angular-file-uploader#for-versions--2x-)
159
163
---
160
164
---
165
+
#### For Versions <6.x:
166
+
Angular file uploader is an Angular 2/4/5/6 file uploader modulewith Real-Time Progress Bar, Angular Universal Compatibility and multiple themes which includes Drag and Drop and much more.
| config : object | It's a javascript object. Use this to add custom constraints to the module. All available key-value pairs are given in example 2.For detailed decription refer the table below. | {} |
247
+
| ApiResponse:EventEmitter | It will return the response it gets back from the uploadAPI. Assign one custom function ,for example " DocUpload($event) " here, where " $event " will contain the response from the api. | |
248
+
| resetUpload : boolean | Give it's value as " true " whenever you want to clear the list of uploads being displayed. It's better to assign one boolean variable ('resetVar' here)to it and then change that variable's value. Remember to change 'resetVar' value 'true' to 'false' after every reset. |false|
| multiple : boolean |Set it as " true "for uploading multiple files at a time and as " false "for single file at a time. |false|
254
+
| formatsAllowed : string | Specify the formats of file you want to upload. |'.jpg,.png,.pdf,.docx, .txt,.gif,.jpeg'|
255
+
| maxSize : number | Maximum size limit for files inMB. |20MB|
256
+
|uploadAPI.url: string | Complete api url to which you want to upload. |undefined|
257
+
|uploadAPI.method: string |HTTP method to use for upload. |POST|
258
+
|uploadAPI.headers: {} | Provide headers you need here. | {} |
259
+
| theme : string | Specify the theme name you want to apply. Available Themes:' dragNDrop ', ' attachPin '| If no theme or wrong theme is specified, default theme will be used instead.|
260
+
| hideProgressBar:boolean |Set it as " true " to hide the Progress bar. |false|
261
+
| hideResetBtn:boolean |Set it as " true " to hide the 'Reset' Button. |false|
262
+
| hideSelectBtn:boolean |Set it as " true " to hide the 'Select File' Button. |false|
263
+
| replaceTexts:object | Replace default texts with your own custom texts. | refer to example-2|
264
+
265
+
---
266
+
##### A Better Way to reset the module
267
+
You have seen that by using 'resetUpload' property, you can reset the module easily, however if you need to reset more than one time, there's a better way of doing that( bcoz in 'resetUpload' property, you have to make it as false in order to use it again):-
268
+
269
+
###### Example-3
270
+
```html
271
+
<angular-file-uploader #fileUpload1
272
+
[config]="afuConfig"
273
+
[resetUpload]=resetVar
274
+
(ApiResponse)="DocUpload($event)">
275
+
</angular-file-uploader>
276
+
```
277
+
- Assign one local reference variable (here 'fileUpload1') to the component.
278
+
- Now use this local reference variable in your xyz.component.ts file.
Angular file uploader is an Angular 2/4/5/6 file uploader module with Real-Time Progress Bar, Angular Universal Compatibility and multiple themes which includes Drag and Drop and much more.
0 commit comments