Search code examples
javascriptangularformsfrontenddropzone

How can I upload a single file using ngx-dropzone in Angular?


I'm using ngx-dropzone in Angular to upload a profile picture with drop zone, but I want the user to upload only one file instead of multiple. Is there a way using ngx-dropzone?

Here you can see the demo:

https://stackblitz.com/edit/ngx-dropzone


Solution

  • You could just disable multiple files upload. Like code below.

    <ngx-dropzone [multiple]="false" (change)="onSelect($event)"></ngx-dropzone>