Image to Base64

Confluence User - 07 Oct, 2023

Hi everybody!

I'm starting with joget

How can I do the following?

I have an image update field (imageField) and another text field of type field with name base64.
I need to image upload in the image field to be converted to base64 format and displayed in the base64 field.

forms;uploadimage

3


10 Oct, 2023
confluenceUser
confluenceUser

Hi, there are multiple ways to do it, you could try following the answers in https://stackoverflow.com/questions/6150289/how-can-i-convert-an-image-into-base64-string-using-javascript.

10 Oct, 2023
confluenceUser
confluenceUser

Hello Anders! thanks for your answer!!
How can I add custom javascript code? In the BeanShell validator of my imageField field?
Like I said, I have a field (imageField) which is a "drop zone" field
I drag and drop an image to this field and I need to convert it to base64 and display it in the imgBase64 field :)
I'm new to Joget :)

11 Oct, 2023
confluenceUser
confluenceUser

You can use the Custom HTML element in your form. Here, you can embed any HTML code including your custom JavaScript.

RELATED QUESTIONS

Your answer


To answer a question you'll need an account.

Print