A plugins to build your own multi uploader for your angular application. This plugin will help you to creat multiple document uploader in your application.
Please support this project by simply putting a Github star. Share this library with friends on Twitter and everywhere else you can.
npm install @binssoft/multi-uploader --save
import "MultiUploaderModule" in your application module. For example: app.module.ts
import {MultiUploaderModule} from '@binssoft/multi-uploader';;
@NgModule({
imports:[
MultiUploaderModule
...
]
})
export class AppModule { }
add configration in your component. For example : app.component.ts
export class AppComponent implements OnInit {
config:any = null;
ngOnInit() {
this.config = {
preview:true,
type:'base64',
upload:{
url:'http://localhost:8080/api/1.0/upload-file',
method:'POST',
body: {
...
_id:1,
...
},
headers: {
"Content-Type": "application/json"
}
}
}
}
Add multi-uploader html tag in your component html. For example : app.component.html
<multi-uploader [config]="config"></multi-uploader>
- [config] : to set the configuration of upload
Description | Default Value | |
---|---|---|
type |
base64 or binary |
base64 |
preview |
show the preview or not | false |
upload |
upload api configuration | |
upload.url |
upload api url | |
upload.method |
upload api method POST , PUT |
|
upload.body |
upload api body | |
upload.headers |
upload api headers |
Click Here for the demo