The Base64 encoding method is used to encode binary data in ASCII text. It is typically used to store or transfer photos, audio files, and other forms of data via the internet. Imagetobase64 is a smartcode from General Method helps to change Image to base64 format.
Smart Code
Syntax
Imagetobase64(Control name,Model,Field name)
Parameters
Control Name (Required)– Select the name of the control, the smartcode applicable to.
Model (Required) – In which model the Image value to be set.
Field Name (Required)– In the Model, which field has to be selected can be defined here.
Direct Code
Syntax
var userimg = await Orefuncs.GetValue(“<<Control Name>.>”, this.state); await Orefuncs.Imagetobase64(“<<Control Name>.>”, userimg); var imguser = Orefuncs.OreDataValidate(Orefuncs.GetProperty(“<<Control Name>.>”, this.state, “source”)); var response = OreApibinding.ModelSetFieldDir(this, “<<Model code>>”,”<<Model Field>>”, imguser);
Example
imagetobase64(FilePicker_1)