FileInput component use base64 encoding/how to decode?

i am trying to pick image input using "fileinput component", the image component stores the value in {{fileinput.value[0]}} for single file.

the default behaviour of file input component is to store in base64 encoded string
this is allowing me to access the base64 string of the image/ that i picked from my system
i want to upload the image, to S3signedurl using put mehtod, i am sending the body as binary
is there a way to "not encode the file to base64", or any way to convert back the fille(image) back to orignal?
as you can see from the screenshot that, the same image picked from fileinput is viewable in image component, it means the the image component decodes the base64 string

Hi @pradhumg , welcome to the community :hugs:

Check this out. They use atob to decode the file and create a blob.

Hope that helps.

1 Like