Hi Rolland,
I download your code and try to "File" content encode and decode, it is not working from webserver
following is the sample code, running from powerbuilder, can you help where is my mistake, tried from browser as well as IWA runner, but no hope, no error is returning.
n_bcrypt in_bc
integer li_fnum,li_rtn
long ll_bytes
Boolean lb_rc
Blob lblob_content, lblob_Encoded, lblob_Decoded
String ls_Message, ls_Encoded, ls_Decoded,ls_source_file,ls_s_file,lss_path
//Read a file and store the content to lblob_Decoded
li_rtn = GetFileOpenName("Select File",ls_source_file, ls_s_file, "Doc", "All Files (*.*), *.*")
li_fnum = FileOpen(ls_source_file , StreamMode!)
ll_bytes = FileReadEx(li_fnum, lblob_content )
messagebox('Read', string(ll_bytes))
//encoding to string
fileclose(li_fnum)
lb_rc = in_bc.of_Base64Encode(lblob_content, ls_Encoded)
if lb_rc then messagebox ( 'lb_rc', 'encode true' ) else messagebox ( 'lb_rc', 'encode False' )
if isnull(ls_Encoded) then ls_Encoded = ''
messagebox('Encode', string(ls_Encoded))
//decoding encoded string to blob
lb_rc = in_bc.of_Base64Decode(ls_Encoded, lblob_Decoded)
if lb_rc then messagebox ( 'lb_rc', 'decode true' ) else messagebox ( 'lb_rc', 'decode False' )
lss_path += "\" + ls_s_file
//
lss_path = ls_source_file+'123'
li_fnum = FileOpen( lss_path, Textmode!,Write!,LockReadWrite!,Replace!)
ll_bytes = FileWriteEx ( li_fnum, lblob_Decoded)
FileClose ( li_fnum )
messagebox('write', string(ll_bytes))
messagebox('write', string(lss_path))
//write lblob_Decoded content to a file and try to open
/////////////////////////////////////////////////////////////////////////////
Regards
Antony
Thank you Roland