Angular 6 File Uploader
Do not open issues for general support questions as we want to keep GitHub issues for bug reports and feature requests. You've got much better chances of getting your question answered on Stack Overflow where the questions should be tagged with tag
To save your and our time, we will systematically close all issues that are requests for general support and redirect people to Stack Overflow.
ngx-uploadermodule as dependency to your project.
npm install ngx-uploader --save
NgxUploaderModuleinto your main AppModule or in module where you will use it.
NgxUploaderModule into your SharedModule. This could be usefull if your project has nested Modules.
Data Structures of Events and Uploaded Files
// output events emitted by ngx-uploader// input events that user can emit to ngx-uploader
With version 4.2.1 we've introduced restrictions for Content-Types. To not break the behaviour of previous releases, there are no restrictions by default at all.
Look at app-home.component.ts for an example of Content-Type restriction.
If you want to toast a message for the rejected file, add this to your onUploadOutput method.
onUploadOutputoutput: UploadOutput: voidelse if output.type === 'rejected' && typeof output.file !== 'undefined'...
If you have to upload files with Token Authorization, you can set the header in startUpload as follows.
You can always run working example by cloning this repository, building project with
yarn build:prod and running server with
For whole template code please check here.
Drag & Dropor choose file(s)Start Upload