Isn't that already there?
onAfterAddingFile is called here
So you could just use uploader.onAfterAddingFile if I am not mistaken?
I would like to add an onBeforeAddingFile though, to resize the image in case it is too big using the source code from @ribizli.
Isn't that already [there?](https://github.com/valor-software/ng2-file-upload/blob/development/components/file-upload/file-uploader.class.ts#L196)
onAfterAddingFile is called [here](https://github.com/valor-software/ng2-file-upload/blob/development/components/file-upload/file-uploader.class.ts#L89)
So you could just use uploader.onAfterAddingFile if I am not mistaken?
I would like to add an onBeforeAddingFile though, to resize the image in case it is too big using [the source code from ](https://github.com/ribizli/ng2-imageupload/blob/master/src/utils.ts) @ribizli.
Could you please give an example on how to subscribe to this event?
It was so easy that now I'm feeling ashamed of myself...
If anyone also confused about this - uploader.onAfterAddingFile = (fileItem) => { //Your code }
~~Could you please give an example on how to subscribe to this event?~~
It was so easy that now I'm feeling ashamed of myself...
If anyone also confused about this -
`
uploader.onAfterAddingFile = (fileItem) => {
//Your code
}
`
@perrosen I don't know, I have lost track of it as I have implemented my own file-input library without the whole upload functionality as this library would have been overkill for my purposes...
@perrosen I don't know, I have lost track of it as I have implemented my own file-input library without the whole upload functionality as this library would have been overkill for my purposes...
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
is there any kind of method that launches an event after a file is set into the uploader queue?
it will be there
Isn't that already there?
onAfterAddingFile is called here
So you could just use uploader.onAfterAddingFile if I am not mistaken?
I would like to add an onBeforeAddingFile though, to resize the image in case it is too big using the source code from @ribizli.
@bergben feel free to reuse my source.
Could you please give an example on how to subscribe to this event?It was so easy that now I'm feeling ashamed of myself...
If anyone also confused about this -
uploader.onAfterAddingFile = (fileItem) => { //Your code }Hi, Is there an example how to use onAfterAddingFile in a controller?
@bergben Was there every any update on adding onBeforeAddingFile?
@perrosen I don't know, I have lost track of it as I have implemented my own file-input library without the whole upload functionality as this library would have been overkill for my purposes...