2

How can I resize image before upload when using ng2-file-upload?

In pure JavaScript I'd load image to Canvas, then resize. Does ng2-file-upload have hany events allowing to pre-process uploades files? Any example?

1 Answer 1

1

You have the possibility to use onAfterAddingFile.

fileUploader: FileUploader = new FileUploader({....})

and the onAfterAddingFile will fire when you add a file:

this.fileUploader.onAfterAddingFile = () => {
   console.log(this.fileUploader.queue)
   // do stuff
};
Sign up to request clarification or add additional context in comments.

1 Comment

So we got a FileItem then what ? What is do stuff ?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.