zefoy / ngx-dropzone-wrapper

Angular wrapper library for Dropzone
MIT License
174 stars 51 forks source link

TransformFile not getting called #91

Closed mkndn closed 6 years ago

mkndn commented 6 years ago

I'm trying to use transformFile config function to convert the file into JSON using FileReader in Angular 5. But i couldn't get it to work. The transformFile function is not getting called when i upload a file.

public config: DropzoneConfigInterface = { url: '/process', clickable: true, maxFiles: 1, transformFile: function (file, done) { done(this.transform(file)); //transform is a function inside my component } }

and the i use it in my html file as,

<dropzone [config]="config" [message]="'Click or drag images here to upload'" (addedFile)="onFileAdded($event)" (error)="onUploadError($event)"

Please help me in getting this to work.

mkndn commented 6 years ago

OK. i resolved it. Its a dumb mistake. I have set

autoProcessQueue to false

in my default config and forgot to set it to true inside custom config in my component. It worked after setting

autoProcessQueue to true