How to execute custom MF after a file/image is chosen?

Hi, In order to simplify the profile picture upload process, I want that after an image/file is chosen (through standard image uploader (browse button) functionality) the process goes further to a custom Microflow (in order to crop the image after it is uploaded). Do you have any advice how to reach this (how to improve the standard browse functionality with custom MF)? Or is there any non-standard action (Java) that I can use to chose/upload an image/file and extend with custom MF?
2 answers

You can capture the onchange event of the file input field in JS.
Add an Action button to your form that triggers the microflow, set the style to "display: none;" and give it a class to identify it, e.g. 'myButton'
Add this javascript (with jquery) to your page, using the HTMLSnippet widget from the appstore:

$('input[type=file]').change(function(e) {  $('.myButton').click();  });

As the image uploader does not support an on change flow there is no simple way to accomplish what you're asking. Of course you can easily add a cropping flow to your save button, but that will obviously only take effect after the page is closed, not directly after upload.

If you don't mind getting your hands dirty you could try implementing your own custom widget, but that would require JavaScript knowledge. Alternatively, you could take a look at the Image Crop widget in the app store, although I fear that is going to fall short of what you are looking for.