I want to convert the image file into base64 Image. used following steps. But wen I check that using any online tool it fails String to image tool
01 I open file in stream Mode and stored into byte variable
02 Convert it to string using AnsiEncode
03 Convert string into base 64 using gcc_system.of_encrypt_base_64('Encrypt Base 64')
Code is as follows
//click event of cb_file_open
Blob lblob_data
Integer li_rc, li_fnum
Long ll_length
String ls_title, ls_pathname, ls_filename, ls_filter
ls_title = "Select a File"
ls_filter = "*.jpg,*.jpeg,*.bmp,*.png"
li_rc = GetFileOpenName(ls_title, ls_pathname, ls_filename, "", ls_filter)
If li_rc < 1 Then
Return
End If
li_fnum = FileOpen(ls_pathname, StreamMode!, Read!)
ll_length = FileReadEx(li_fnum, lblob_data)
FileClose(li_fnum)
mle_response.text = String(lblob_data, EncodingAnsi!)
mle_output.txt = gcc_system.of_encrypt_base_64('Encrypt Base 64')
I also tried using Topwiz bcrypt tool using following steps attaching image
01 Button Hash a file
02 copy sle_result.text to mle_message (convert sle_message to mle_message)
03 click button cb_base64
04 copy sle_result.text and test in online tool
Blob lblob_data
Int li_fnum
Long ll_length
String ls_pathname, ls_encoded
ULong lul_len, lul_buflen
Boolean lb_rtn
ls_pathname = "D:\tss\images\png\128x128\msgioin.png"
li_fnum = FileOpen(ls_pathname, StreamMode!, Read!)
ll_length = FileReadEx(li_fnum, lblob_data)
FileClose(li_fnum)
lul_len = Len(lblob_data)
lul_buflen = 2 + 1.5 * (lul_len + 2)
lb_rtn = CryptBinaryToString(lblob_data, &
lul_len, CRYPT_STRING_BASE64, &
ls_encoded, lul_buflen)
mle_response.text = ls_encoded