Enonic version: 7.1.1
OS: Windows 10
Hi,
I’m creating a contact form where the user has the option to upload attachments.
Form:
<form method="post" id="conntactForm" data-th-action="${serviceUrl}" action="#" role="contactUs" target="hiddenFrame" enctype="multipart/form-data" class="form mr-auto">
<input type="file" class="btn btn-primary" name="image">Legg til bilder<input>
</form>
I’m using this code in the service:
var image = portalLib.getMultipartItem('image');
log.info(JSON.stringify(image));
var imageStream = portalLib.getMultipartStream('image')
log.info(JSON.stringify(imageStream));
Image
{
“name”: “image”,
“fileName”: “Org-kart-2020.png”,
“contentType”: “image/png”,
“size”: 931330
}
but imageStream returns undefined.
I’m I missing something?