- PRASHANT NIRGUN
- PowerBuilder
- Saturday, 27 August 2022 06:06 PM UTC
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
Find Questions by Tag
Helpful?
If a reply or comment is helpful for you, please don’t hesitate to click the Helpful button. This action is further confirmation of their invaluable contribution to the Appeon Community.