Sending the uploaded image in the form field as email attachment


Once a form is submitted, We need to send a confirmation mail along with the image uploaded.

But we are facing issue to receive the image at the backend, can anyone please respond if they

have done this before.


Hi Nirish,
I presume you are using the ootb ConfirmationBehavior? I think it doesn’t support this case.
The MailFormDataBehavior (for mailing a form to the back-end) does support uploads so a way out is to create your own behavior that combines the two.


[1] Submission Confirmation Behavior - Bloomreach Experience - Open Source CMS

Hi jeroen,

Thanks for the response, we are not using ootb confirmation behaviour.
We are using below code in frontend:

form method=“post” enctype=“multipart/form-data”
input type=“file” name=“add-images” class=" " data-max-size=“1”

In the backend we have a class which extends EformComponent and in that we are using below code to get form data:

FormBean form = getFormBean(request);
String[] formFields = fieldsInsideAForm(form);
FormMap map = new FormMap(request,formFields);

Now the issue is we need to get the image file from formField and sent it to an email.
Can you please share how it can be solved

you need to parse file parts yourself. You can check old forms code base as an example, mainly:


all project:

1 Like